Skip to content

Commit 62553de

Browse files
committed
Merge branch 'ieeFix' of github.com:JabRef/jabref into ieeFix
* '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)
2 parents 2fbfaf4 + ef2add7 commit 62553de

25 files changed

+212
-126
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,15 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
5656
- 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)
5757
- 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)
5858
- We added additional modifiers (capitalize, titlecase and sentencecase) to the Bibtex key generator. [#1506](https://github.com/JabRef/jabref/issues/1506)
59-
- We grouped the toolbar icons and changed the Open Library and Copy icons. [#4584](https://github.com/JabRef/jabref/issues/4584)
59+
- We grouped the toolbar icons and changed the Open Library and Copy icons. [#4584](https://github.com/JabRef/jabref/issues/4584)
6060
- We added a browse button next to the path text field for aux-based groups. [#4586](https://github.com/JabRef/jabref/issues/4586)
6161
- We changed the title of Group Dialog to "Add subgroup" from "Edit group" when we select Add subgroup option.
6262
- We enable import button only if entries are selected. [#4755](https://github.com/JabRef/jabref/issues/4755)
6363
- We made modifications to improve contrast of UI elements. [#4583](https://github.com/JabRef/jabref/issues/4583)
6464
- 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)
6565
- The Medline fetcher now normalizes the author names according to the BibTeX-Standard [#4345](https://github.com/JabRef/jabref/issues/4345)
6666
- 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)
67+
- We added an option in the preference dialog box that allows user to enable helpful tooltips.[#3599](https://github.com/JabRef/jabref/issues/3599)
6768

6869

6970
### Fixed
@@ -116,6 +117,12 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
116117
- 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)
117118
- We fixed an issue where a database exception related to a missing timezone was too big. [#4827](https://github.com/JabRef/jabref/issues/4827)
118119
- 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)
120+
- 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)
121+
- 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)
122+
- 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)
123+
124+
125+
119126

120127
### Removed
121128
- 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.

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ JabRef is an open-source, cross-platform citation and reference management tool
99
Stay on top of your literature: JabRef helps you to collect and organize sources, find the paper you need and discover the latest research.
1010
![main table](https://www.jabref.org/img/JabRef-4-0-MainTable.png)
1111

12+
## Table of Contents
13+
14+
- [Features](#features)
15+
- [Installation](#installation)
16+
- [Bug Reports, Suggestions, Other Feedback](#bug-reports-suggestions-other-feedback)
17+
- [Contributing](#contributing)
18+
- [Acknowledgements](#acknowledgements) / [License](#license)
19+
1220
## Features
1321

1422
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.

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ dependencies {
9494
compile 'org.apache.pdfbox:fontbox:2.0.15'
9595
compile 'org.apache.pdfbox:xmpbox:2.0.15'
9696

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

9999
// required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635
100100
compile 'org.bouncycastle:bcprov-jdk15on:1.61'
@@ -130,7 +130,7 @@ dependencies {
130130
compile 'de.saxsys:mvvmfx:1.8.0'
131131
compile 'org.fxmisc.easybind:easybind:1.0.3'
132132
compile 'org.fxmisc.flowless:flowless:0.6.1'
133-
compile 'org.fxmisc.richtext:richtextfx:0.10.0'
133+
compile 'org.fxmisc.richtext:richtextfx:0.10.1'
134134
compile 'com.sibvisions.external.jvxfx:dndtabpane:0.1'
135135
compile 'javax.inject:javax.inject:1'
136136
compile 'com.jfoenix:jfoenix:8.0.8'

src/main/java/org/jabref/cli/JabRefCLI.java

+54-64
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import org.jabref.Globals;
66
import org.jabref.logic.l10n.Localization;
7-
import org.jabref.model.database.BibDatabaseMode;
87

98
import org.apache.commons.cli.CommandLine;
109
import org.apache.commons.cli.DefaultParser;
@@ -17,27 +16,25 @@
1716

1817
public class JabRefCLI {
1918

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

2424
public JabRefCLI(String[] args) {
25-
2625
Options options = getOptions();
27-
2826
try {
2927
this.cl = new DefaultParser().parse(options, args);
3028
this.leftOver = cl.getArgList();
3129
} catch (ParseException e) {
3230
LOGGER.warn("Problem parsing arguments", e);
33-
3431
this.printUsage();
3532
throw new RuntimeException();
3633
}
3734
}
3835

3936
public static String getExportMatchesSyntax() {
40-
return String.format("[%s]searchTerm,outputFile: %s[,%s]",
37+
return String.format("[%s]searchTerm,outputFile:%s[,%s]",
4138
Localization.lang("field"),
4239
Localization.lang("file"),
4340
Localization.lang("exportFormat"));
@@ -147,104 +144,97 @@ public String getExportMatches() {
147144
return cl.getOptionValue("exportMatches");
148145
}
149146

150-
public boolean isGenerateBibtexKeys() { return cl.hasOption("generateBibtexKeys"); }
147+
public boolean isGenerateBibtexKeys() {
148+
return cl.hasOption("generateBibtexKeys");
149+
}
151150

152-
public boolean isAutomaticallySetFileLinks() { return cl.hasOption("automaticallySetFileLinks"); }
151+
public boolean isAutomaticallySetFileLinks() {
152+
return cl.hasOption("automaticallySetFileLinks");
153+
}
153154

154155
private Options getOptions() {
155156
Options options = new Options();
156157

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

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

167170
options.addOption(Option.builder("i").
168171
longOpt("import").
169-
desc(String.format("%s: %s[,import format]", Localization.lang("Import file"),
170-
Localization.lang("filename"))).
172+
desc(String.format("%s: '%s'", Localization.lang("Import file"), "-i library.bib")).
171173
hasArg().
172-
argName("FILE").build());
174+
argName("FILE[,FORMAT]").
175+
build());
173176

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

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

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

197-
options.addOption(Option.builder("p").
198-
longOpt("primp").
199-
desc(Localization.lang("Import preferences from file")).
198+
options.addOption(Option.builder("m").
199+
longOpt("exportMatches").
200+
desc(String.format("%s: '%s'", Localization.lang("Matching"), "-i db.bib -m author=Newton,search.htm,html")).
200201
hasArg().
201-
argName("FILE").
202+
argName("QUERY,FILE[,FORMAT]").
202203
build());
203-
options.addOption(Option.builder("d").
204-
longOpt("prdef").
205-
desc(Localization.lang("Reset preferences (key1,key2,... or 'all')")).
204+
205+
options.addOption(Option.builder("f").
206+
longOpt("fetch").
207+
desc(String.format("%s: '%s'", Localization.lang("Run fetcher"), "-f Medline/PubMed:cancer")).
206208
hasArg().
207-
argName("FILE").
209+
argName("FETCHER:QUERY").
208210
build());
209211

210212
options.addOption(Option.builder("a").
211213
longOpt("aux").
212-
desc(String.format("%s: %s[.aux],%s[.bib]", Localization.lang("Sublibrary from AUX"),
213-
Localization.lang("file"),
214-
Localization.lang("new"))).
214+
desc(String.format("%s: '%s'", Localization.lang("Sublibrary from AUX to BibTeX"), "-a thesis.aux,new.bib")).
215215
hasArg().
216-
argName("FILE").
216+
argName("FILE[.aux],FILE[.bib] FILE").
217217
build());
218218

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

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

233-
options.addOption(Option.builder("m").
234-
longOpt("exportMatches").
235-
desc(JabRefCLI.getExportMatchesSyntax()).
233+
options.addOption(Option.builder("d").
234+
longOpt("prdef").
235+
desc(String.format("%s: '%s'", Localization.lang("Reset preferences"), "-d mainFontSize,newline' or '-d all")).
236236
hasArg().
237-
argName("FILE").
238-
build());
239-
240-
options.addOption(Option.builder("g").
241-
longOpt("generateBibtexKeys").
242-
desc(Localization.lang("Regenerate all keys for the entries in a BibTeX file"))
243-
.build());
244-
245-
options.addOption(Option.builder("asfl").
246-
longOpt("automaticallySetFileLinks").
247-
desc(Localization.lang("Automatically set file links")).
237+
argName("KEY1[,KEY2][,KEYn] | all").
248238
build());
249239

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

268258
HelpFormatter formatter = new HelpFormatter();
269-
formatter.printHelp("jabref [OPTIONS] [BIBTEX_FILE]\n\nOptions:", header, getOptions(), footer, true);
259+
formatter.printHelp(WIDTH, "jabref [OPTIONS] [BIBTEX_FILE]\n\nOptions:", header, getOptions(), footer, true);
270260
}
271261

272262
private String getVersionInfo() {

src/main/java/org/jabref/gui/Base.css

+4
Original file line numberDiff line numberDiff line change
@@ -1032,3 +1032,7 @@ We want to have a look that matches our icons in the tool-bar */
10321032
-fx-font-size: 1.5em;
10331033
-fx-padding: 1em 0em 1em 0em;
10341034
}
1035+
1036+
.dialog-pane {
1037+
-fx-background-color: -fx-control-inner-background;
1038+
}

src/main/java/org/jabref/gui/actions/ActionFactory.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import java.lang.reflect.Method;
55
import java.util.Objects;
66

7-
import javafx.scene.Node;
87
import javafx.scene.control.Button;
98
import javafx.scene.control.ButtonBase;
109
import javafx.scene.control.CheckMenuItem;
@@ -148,13 +147,9 @@ public ButtonBase configureIconButton(Action action, Command command, ButtonBase
148147
button.getStyleClass().add("icon-button");
149148

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

159154
return button;
160155
}

src/main/java/org/jabref/gui/entryeditor/EntryEditor.css

+10
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
-fx-background-color: -jr-icon-background-active;
3232
}
3333

34+
#typeLabel .context-menu {
35+
-fx-font-size: 0.92em;
36+
-fx-font-weight: normal;
37+
}
38+
39+
#typeLabel .tooltip {
40+
-fx-font-size: 1em;
41+
-fx-font-weight: normal;
42+
}
43+
3444
.icon-button.narrow {
3545
-fx-padding: 0.1em;
3646
}

src/main/java/org/jabref/gui/entryeditor/EntryEditor.fxml

+8-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@
4040
<Tooltip text="%Change entry type"/>
4141
</tooltip>
4242
</Button>
43-
<Button fx:id="generateCiteKeyButton" styleClass="narrow"/>
43+
<Button styleClass="icon-button,narrow" onAction="#generateCiteKeyButton">
44+
<graphic>
45+
<JabRefIconView glyph="MAKE_KEY"/>
46+
</graphic>
47+
<tooltip>
48+
<Tooltip text="%Generate BibTeX key"/>
49+
</tooltip>
50+
</Button>
4451
<Button fx:id="fetcherButton" styleClass="icon-button,narrow">
4552
<graphic>
4653
<JabRefIconView glyph="REFRESH"/>

src/main/java/org/jabref/gui/entryeditor/EntryEditor.java

+6-10
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
import org.jabref.gui.BasePanel;
2828
import org.jabref.gui.DialogService;
2929
import org.jabref.gui.GUIGlobals;
30-
import org.jabref.gui.actions.ActionFactory;
31-
import org.jabref.gui.actions.StandardActions;
3230
import org.jabref.gui.bibtexkeypattern.GenerateBibtexKeySingleAction;
3331
import org.jabref.gui.entryeditor.fileannotationtab.FileAnnotationTab;
3432
import org.jabref.gui.externalfiles.ExternalFilesEntryLinker;
@@ -87,7 +85,6 @@ public class EntryEditor extends BorderPane {
8785
@FXML private Button typeChangeButton;
8886
@FXML private Button fetcherButton;
8987
@FXML private Label typeLabel;
90-
@FXML private Button generateCiteKeyButton;
9188

9289
private final EntryEditorPreferences preferences;
9390
private final DialogService dialogService;
@@ -261,6 +258,12 @@ private void deleteEntry() {
261258
panel.delete(entry);
262259
}
263260

261+
@FXML
262+
void generateCiteKeyButton() {
263+
GenerateBibtexKeySingleAction action = new GenerateBibtexKeySingleAction(getEntry(), databaseContext, dialogService, preferences, undoManager);
264+
action.execute();
265+
}
266+
264267
@FXML
265268
private void navigateToPreviousEntry() {
266269
panel.selectPreviousEntry();
@@ -387,13 +390,6 @@ private void setupToolBar() {
387390
fetcherMenu.getItems().add(fetcherMenuItem);
388391
}
389392
fetcherButton.setOnMouseClicked(event -> fetcherMenu.show(fetcherButton, Side.RIGHT, 0, 0));
390-
391-
// Configure cite key button
392-
new ActionFactory(preferences.getKeyBindings())
393-
.configureIconButton(
394-
StandardActions.GENERATE_CITE_KEY,
395-
new GenerateBibtexKeySingleAction(getEntry(), databaseContext, dialogService, preferences, undoManager),
396-
generateCiteKeyButton);
397393
}
398394

399395
private void fetchAndMerge(EntryBasedFetcher fetcher) {

0 commit comments

Comments
 (0)