Skip to content

Commit

Permalink
Merge branch 'ieeFix' of github.com:JabRef/jabref into ieeFix
Browse files Browse the repository at this point in the history
* 'ieeFix' of github.com:JabRef/jabref:
  Fix the 'Attach file' dialog for starting on the user's main directory (#4996)
  Readme TOC (#4986)
  Fix icon size - the second (#4993)
  Fix background color of dialogs in dark mode (#4994)
  NPE-fix for Preferences/Ext-Prog/Settings for X/Browse  (#4983)
  Bump richtextfx from 0.10.0 to 0.10.1 (#4989)
  Bump tika-core from 1.20 to 1.21 (#4984)
  Resize different fonts changing entry type (#4980)
  Extended Hints - Alternative to #4971 (#4975)
  Fix command line help text (#4979)
  • Loading branch information
Siedlerchr committed May 26, 2019
2 parents 2fbfaf4 + ef2add7 commit 62553de
Show file tree
Hide file tree
Showing 25 changed files with 212 additions and 126 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We added the ability to execute default action in dialog by using with <kbd>Ctrl</kbd> + <kbd>Enter</kbd> combination [#4496](https://github.com/JabRef/jabref/issues/4496)
- We grouped and reordered the Main Menu (File, Edit, Library, Quality, Tools, and View tabs & icons). [#4666](https://github.com/JabRef/jabref/issues/4666) [#4667](https://github.com/JabRef/jabref/issues/4667) [#4668](https://github.com/JabRef/jabref/issues/4668) [#4669](https://github.com/JabRef/jabref/issues/4669) [#4670](https://github.com/JabRef/jabref/issues/4670) [#4671](https://github.com/JabRef/jabref/issues/4671) [#4672](https://github.com/JabRef/jabref/issues/4672) [#4673](https://github.com/JabRef/jabref/issues/4673)
- We added additional modifiers (capitalize, titlecase and sentencecase) to the Bibtex key generator. [#1506](https://github.com/JabRef/jabref/issues/1506)
- We grouped the toolbar icons and changed the Open Library and Copy icons. [#4584](https://github.com/JabRef/jabref/issues/4584)
- We grouped the toolbar icons and changed the Open Library and Copy icons. [#4584](https://github.com/JabRef/jabref/issues/4584)
- We added a browse button next to the path text field for aux-based groups. [#4586](https://github.com/JabRef/jabref/issues/4586)
- We changed the title of Group Dialog to "Add subgroup" from "Edit group" when we select Add subgroup option.
- We enable import button only if entries are selected. [#4755](https://github.com/JabRef/jabref/issues/4755)
- We made modifications to improve contrast of UI elements. [#4583](https://github.com/JabRef/jabref/issues/4583)
- We added an option in the settings to set the default action in JabRef when right clicking on any entry in any database and selecting "Open folder". [#4763](https://github.com/JabRef/jabref/issues/4763)
- The Medline fetcher now normalizes the author names according to the BibTeX-Standard [#4345](https://github.com/JabRef/jabref/issues/4345)
- We added an option on the Linked File Viewer to rename the attached file of an entry directly on the JabRef. [#4844](https://github.com/JabRef/jabref/issues/4844)
- We added an option in the preference dialog box that allows user to enable helpful tooltips.[#3599](https://github.com/JabRef/jabref/issues/3599)


### Fixed
Expand Down Expand Up @@ -116,6 +117,12 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where an NullPointer exception was thrown when a referenced entry in an Open/Libre Office document was no longer present in the library. Now an error message with the reference marker of the missing entry is shown. [#4932](https://github.com/JabRef/jabref/issues/4932)
- We fixed an issue where a database exception related to a missing timezone was too big. [#4827](https://github.com/JabRef/jabref/issues/4827)
- We fixed an issue where the IEEE fetcher returned an error if no keywords were present in the result from the IEEE website [#4997](https://github.com/JabRef/jabref/issues/4997)
- We fixed an issue where the command line help text had several errors, and arguments and descriptions have been rewritten to simplify and detail them better. [#4932](https://github.com/JabRef/jabref/issues/2016)
- We fixed an issue where the same menu for changing entry type had two different sizes and weights. [#4977](https://github.com/JabRef/jabref/issues/4977)
- We fixed an issue where the "Attach file" dialog, in the right-click menu for an entry, started on the working directory instead of the user's main directory. [#4995](https://github.com/JabRef/jabref/issues/4995)




### Removed
- The feature to "mark entries" was removed and merged with the groups functionality. For migration, a group is created for every value of the `__markedentry` field and the entry is added to this group.
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ JabRef is an open-source, cross-platform citation and reference management tool
Stay on top of your literature: JabRef helps you to collect and organize sources, find the paper you need and discover the latest research.
![main table](https://www.jabref.org/img/JabRef-4-0-MainTable.png)

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Bug Reports, Suggestions, Other Feedback](#bug-reports-suggestions-other-feedback)
- [Contributing](#contributing)
- [Acknowledgements](#acknowledgements) / [License](#license)

## Features

JabRef is a cross-platform application that works on Windows, Linux and Mac OS X. It is available free of charge and is actively developed.
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ dependencies {
compile 'org.apache.pdfbox:fontbox:2.0.15'
compile 'org.apache.pdfbox:xmpbox:2.0.15'

compile group: 'org.apache.tika', name: 'tika-core', version: '1.20'
compile group: 'org.apache.tika', name: 'tika-core', version: '1.21'

// required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635
compile 'org.bouncycastle:bcprov-jdk15on:1.61'
Expand Down Expand Up @@ -130,7 +130,7 @@ dependencies {
compile 'de.saxsys:mvvmfx:1.8.0'
compile 'org.fxmisc.easybind:easybind:1.0.3'
compile 'org.fxmisc.flowless:flowless:0.6.1'
compile 'org.fxmisc.richtext:richtextfx:0.10.0'
compile 'org.fxmisc.richtext:richtextfx:0.10.1'
compile 'com.sibvisions.external.jvxfx:dndtabpane:0.1'
compile 'javax.inject:javax.inject:1'
compile 'com.jfoenix:jfoenix:8.0.8'
Expand Down
118 changes: 54 additions & 64 deletions src/main/java/org/jabref/cli/JabRefCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import org.jabref.Globals;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseMode;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DefaultParser;
Expand All @@ -17,27 +16,25 @@

public class JabRefCLI {

private static final int WIDTH = 100; // Number of characters per line
private static final Logger LOGGER = LoggerFactory.getLogger(JabRefCLI.class);
private final CommandLine cl;
private List<String> leftOver;

public JabRefCLI(String[] args) {

Options options = getOptions();

try {
this.cl = new DefaultParser().parse(options, args);
this.leftOver = cl.getArgList();
} catch (ParseException e) {
LOGGER.warn("Problem parsing arguments", e);

this.printUsage();
throw new RuntimeException();
}
}

public static String getExportMatchesSyntax() {
return String.format("[%s]searchTerm,outputFile: %s[,%s]",
return String.format("[%s]searchTerm,outputFile:%s[,%s]",
Localization.lang("field"),
Localization.lang("file"),
Localization.lang("exportFormat"));
Expand Down Expand Up @@ -147,104 +144,97 @@ public String getExportMatches() {
return cl.getOptionValue("exportMatches");
}

public boolean isGenerateBibtexKeys() { return cl.hasOption("generateBibtexKeys"); }
public boolean isGenerateBibtexKeys() {
return cl.hasOption("generateBibtexKeys");
}

public boolean isAutomaticallySetFileLinks() { return cl.hasOption("automaticallySetFileLinks"); }
public boolean isAutomaticallySetFileLinks() {
return cl.hasOption("automaticallySetFileLinks");
}

private Options getOptions() {
Options options = new Options();

// boolean options
options.addOption("v", "version", false, Localization.lang("Display version"));
options.addOption("n", "nogui", false, Localization.lang("No GUI. Only process command line options."));
options.addOption("h", "help", false, Localization.lang("Display help on command line options"));
options.addOption("n", "nogui", false, Localization.lang("No GUI. Only process command line options"));
options.addOption("asfl", "automaticallySetFileLinks", false, Localization.lang("Automatically set file links"));
options.addOption("g", "generateBibtexKeys", false, Localization.lang("Regenerate all keys for the entries in a BibTeX file"));
options.addOption("b", "blank", false, Localization.lang("Do not open any files at startup"));
options.addOption("v", "version", false, Localization.lang("Display version"));
options.addOption(null, "debug", false, Localization.lang("Show debug level messages"));

// The "-console" option is handled by the install4j launcher
options.addOption(null, "console", false, Localization.lang("Show console output (only necessary when the launcher is used)"));
options.addOption(null, "console", false, Localization.lang("Show console output (only when the launcher is used)"));

options.addOption(Option.builder("i").
longOpt("import").
desc(String.format("%s: %s[,import format]", Localization.lang("Import file"),
Localization.lang("filename"))).
desc(String.format("%s: '%s'", Localization.lang("Import file"), "-i library.bib")).
hasArg().
argName("FILE").build());
argName("FILE[,FORMAT]").
build());

options.addOption(
Option.builder("ib")
.longOpt("importBibtex")
.desc(String.format("%s: %s[,importBibtex bibtexString]", Localization.lang("Import") + " " + BibDatabaseMode.BIBTEX.getFormattedName(), Localization.lang("filename")))
.hasArg()
.argName("FILE")
.build());
options.addOption(Option.builder().
longOpt("importToOpen").
desc(Localization.lang("Same as --import, but will be imported to the opened tab")).
hasArg().
argName("FILE[,FORMAT]").
build());

options.addOption(Option.builder("o").
longOpt("output").
desc(String.format("%s: %s[,export format]", Localization.lang("Output or export file"),
Localization.lang("filename"))).
options.addOption(Option.builder("ib").
longOpt("importBibtex").
desc(String.format("%s: '%s'", Localization.lang("Import BibTeX"), "-ib @article{entry}")).
hasArg().
argName("FILE").
argName("BIBTEXT_STRING").
build());

options.addOption(Option.builder("x").
longOpt("prexp").
desc(Localization.lang("Export preferences to file")).
options.addOption(Option.builder("o").
longOpt("output").
desc(String.format("%s: '%s'", Localization.lang("Export an input to a file"), "-i db.bib -o db.htm,html")).
hasArg().
argName("FILE").
argName("FILE[,FORMAT]").
build());

options.addOption(Option.builder("p").
longOpt("primp").
desc(Localization.lang("Import preferences from file")).
options.addOption(Option.builder("m").
longOpt("exportMatches").
desc(String.format("%s: '%s'", Localization.lang("Matching"), "-i db.bib -m author=Newton,search.htm,html")).
hasArg().
argName("FILE").
argName("QUERY,FILE[,FORMAT]").
build());
options.addOption(Option.builder("d").
longOpt("prdef").
desc(Localization.lang("Reset preferences (key1,key2,... or 'all')")).

options.addOption(Option.builder("f").
longOpt("fetch").
desc(String.format("%s: '%s'", Localization.lang("Run fetcher"), "-f Medline/PubMed:cancer")).
hasArg().
argName("FILE").
argName("FETCHER:QUERY").
build());

options.addOption(Option.builder("a").
longOpt("aux").
desc(String.format("%s: %s[.aux],%s[.bib]", Localization.lang("Sublibrary from AUX"),
Localization.lang("file"),
Localization.lang("new"))).
desc(String.format("%s: '%s'", Localization.lang("Sublibrary from AUX to BibTeX"), "-a thesis.aux,new.bib")).
hasArg().
argName("FILE").
argName("FILE[.aux],FILE[.bib] FILE").
build());

options.addOption(Option.builder().
longOpt("importToOpen").
desc(Localization.lang("Import to open tab")).
options.addOption(Option.builder("x").
longOpt("prexp").
desc(String.format("%s: '%s'", Localization.lang("Export preferences to a file"), "-x prefs.xml")).
hasArg().
argName("FILE").
argName("[FILE]").
build());

options.addOption(Option.builder("f").
longOpt("fetch").
desc(Localization.lang("Run fetcher, e.g. \"--fetch=Medline:cancer\"")).
options.addOption(Option.builder("p").
longOpt("primp").
desc(String.format("%s: '%s'", Localization.lang("Import preferences from a file"), "-p prefs.xml")).
hasArg().
argName("FILE").
argName("[FILE]").
build());

options.addOption(Option.builder("m").
longOpt("exportMatches").
desc(JabRefCLI.getExportMatchesSyntax()).
options.addOption(Option.builder("d").
longOpt("prdef").
desc(String.format("%s: '%s'", Localization.lang("Reset preferences"), "-d mainFontSize,newline' or '-d all")).
hasArg().
argName("FILE").
build());

options.addOption(Option.builder("g").
longOpt("generateBibtexKeys").
desc(Localization.lang("Regenerate all keys for the entries in a BibTeX file"))
.build());

options.addOption(Option.builder("asfl").
longOpt("automaticallySetFileLinks").
desc(Localization.lang("Automatically set file links")).
argName("KEY1[,KEY2][,KEYn] | all").
build());

return options;
Expand All @@ -266,7 +256,7 @@ public void printUsage() {
String footer = '\n' + importFormatsList + outFormatsList + "\nPlease report issues at https://github.com/JabRef/jabref/issues.";

HelpFormatter formatter = new HelpFormatter();
formatter.printHelp("jabref [OPTIONS] [BIBTEX_FILE]\n\nOptions:", header, getOptions(), footer, true);
formatter.printHelp(WIDTH, "jabref [OPTIONS] [BIBTEX_FILE]\n\nOptions:", header, getOptions(), footer, true);
}

private String getVersionInfo() {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1032,3 +1032,7 @@ We want to have a look that matches our icons in the tool-bar */
-fx-font-size: 1.5em;
-fx-padding: 1em 0em 1em 0em;
}

.dialog-pane {
-fx-background-color: -fx-control-inner-background;
}
9 changes: 2 additions & 7 deletions src/main/java/org/jabref/gui/actions/ActionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.lang.reflect.Method;
import java.util.Objects;

import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonBase;
import javafx.scene.control.CheckMenuItem;
Expand Down Expand Up @@ -148,13 +147,9 @@ public ButtonBase configureIconButton(Action action, Command command, ButtonBase
button.getStyleClass().add("icon-button");

// For some reason the graphic is not set correctly, so let's fix this
// ToDO: Find a way to reuse JabRefIconView
button.graphicProperty().unbind();
action.getIcon().ifPresent(icon -> {
// ToDO: Find a way to reuse JabRefIconView
Node graphicNode = icon.getGraphicNode();
graphicNode.setStyle(String.format("-fx-font-family: %s; -fx-font-size: %s;", icon.fontFamily(), "1em"));
button.setGraphic(graphicNode);
});
action.getIcon().ifPresent(icon -> button.setGraphic(icon.getGraphicNode()));

return button;
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
-fx-background-color: -jr-icon-background-active;
}

#typeLabel .context-menu {
-fx-font-size: 0.92em;
-fx-font-weight: normal;
}

#typeLabel .tooltip {
-fx-font-size: 1em;
-fx-font-weight: normal;
}

.icon-button.narrow {
-fx-padding: 0.1em;
}
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/jabref/gui/entryeditor/EntryEditor.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@
<Tooltip text="%Change entry type"/>
</tooltip>
</Button>
<Button fx:id="generateCiteKeyButton" styleClass="narrow"/>
<Button styleClass="icon-button,narrow" onAction="#generateCiteKeyButton">
<graphic>
<JabRefIconView glyph="MAKE_KEY"/>
</graphic>
<tooltip>
<Tooltip text="%Generate BibTeX key"/>
</tooltip>
</Button>
<Button fx:id="fetcherButton" styleClass="icon-button,narrow">
<graphic>
<JabRefIconView glyph="REFRESH"/>
Expand Down
16 changes: 6 additions & 10 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import org.jabref.gui.BasePanel;
import org.jabref.gui.DialogService;
import org.jabref.gui.GUIGlobals;
import org.jabref.gui.actions.ActionFactory;
import org.jabref.gui.actions.StandardActions;
import org.jabref.gui.bibtexkeypattern.GenerateBibtexKeySingleAction;
import org.jabref.gui.entryeditor.fileannotationtab.FileAnnotationTab;
import org.jabref.gui.externalfiles.ExternalFilesEntryLinker;
Expand Down Expand Up @@ -87,7 +85,6 @@ public class EntryEditor extends BorderPane {
@FXML private Button typeChangeButton;
@FXML private Button fetcherButton;
@FXML private Label typeLabel;
@FXML private Button generateCiteKeyButton;

private final EntryEditorPreferences preferences;
private final DialogService dialogService;
Expand Down Expand Up @@ -261,6 +258,12 @@ private void deleteEntry() {
panel.delete(entry);
}

@FXML
void generateCiteKeyButton() {
GenerateBibtexKeySingleAction action = new GenerateBibtexKeySingleAction(getEntry(), databaseContext, dialogService, preferences, undoManager);
action.execute();
}

@FXML
private void navigateToPreviousEntry() {
panel.selectPreviousEntry();
Expand Down Expand Up @@ -387,13 +390,6 @@ private void setupToolBar() {
fetcherMenu.getItems().add(fetcherMenuItem);
}
fetcherButton.setOnMouseClicked(event -> fetcherMenu.show(fetcherButton, Side.RIGHT, 0, 0));

// Configure cite key button
new ActionFactory(preferences.getKeyBindings())
.configureIconButton(
StandardActions.GENERATE_CITE_KEY,
new GenerateBibtexKeySingleAction(getEntry(), databaseContext, dialogService, preferences, undoManager),
generateCiteKeyButton);
}

private void fetchAndMerge(EntryBasedFetcher fetcher) {
Expand Down
Loading

0 comments on commit 62553de

Please sign in to comment.