Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into exportPDF
Browse files Browse the repository at this point in the history
* upstream/master:
  fix ID consideration in DuplicateCheck
  Add ArXiv identifier batch lookup (#2710)
  Update mockito from 2.7.19 to 2.7.21
  More defensive identifier list #2708
  Revert "Add more identifier field names #2708"
  Add more identifier field names #2708
  Consider entries as equal if their DOI matches #2708
  Imports
  Imports
  Move duplicate detection to logic
  Reuse edit distance class
  Refactoring
  EntryTypeDialog Fetching Autogenerates BibTeX Key (#2709)
  Add changelog entry
  Increase permitted size of StringUtil
  Make sure that JavaFx shuts down in case another JabRef instance is already open
  • Loading branch information
Siedlerchr committed Apr 5, 2017
2 parents bd508ad + a1f4101 commit c9eeefd
Show file tree
Hide file tree
Showing 25 changed files with 248 additions and 203 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- The `Move linked files to default file directory`-Cleanup operation respects the `File directory pattern` setting
- We separated the `Move file` and `Rename Pdfs` logic and context menu entries in the `General`-Tab for the Field `file` to improve the semantics
- A scrollbar was added to the cleanup panel, as a result of issue [#2501](https://github.com/JabRef/jabref/issues/2501)
- Using "Look up document identifier" in the quality menu, it is possible to look up DOIs and other identifiers for multiple entries.
- Using "Look up document identifier" in the quality menu, it is possible to look up DOIs, ArXiv ids and other identifiers for multiple entries.
- F4 opens selected file in current JTable context not just from selected entry inside the main table [#2355](https://github.com/JabRef/jabref/issues/2355)
- We added an option to copy the title of BibTeX entries to the clipboard through `Edit -> Copy title` (implements [#210](https://github.com/koppor/jabref/issues/210))
- Several scrollbars were added to the preference dialog which show up when content is too large [#2559](https://github.com/JabRef/jabref/issues/2559)
Expand All @@ -66,6 +66,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- The `day` part of the biblatex `date` field is now exported to the corresponding `day` field in MS-Office XML. [#2691](https://github.com/JabRef/jabref/issues/2691)

### Fixed
- We fixed an issue of duplicate keys after using a fetcher, e.g., DOI or ISBN [#2867](https://github.com/JabRef/jabref/issues/2687)
- We fixed an issue that prevented multiple parallel JabRef instances from terminating gracefully. [#2698](https://github.com/JabRef/jabref/issues/2698)
- We fixed an issue where authors with multiple surnames were not presented correctly in the main table. [#2534](https://github.com/JabRef/jabref/issues/2534)
- Repairs the handling of apostrophes in the LaTeX to unicode conversion. [#2500](https://github.com/JabRef/jabref/issues/2500)
- Fix import of journal title in ris format. [#2506](https://github.com/JabRef/jabref/issues/2506)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ dependencies {
compile 'com.github.tomtung:latex2unicode_2.12:0.2'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.7.19'
testCompile 'org.mockito:mockito-core:2.7.21'
testCompile 'com.github.tomakehurst:wiremock:2.5.1'
testCompile 'org.assertj:assertj-swing-junit:3.5.0'
testCompile 'org.reflections:reflections:0.9.11'
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/JabRefMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ private static void start(String[] args) {
// So we assume it's all taken care of, and quit.
LOGGER.info(Localization.lang("Arguments passed on to running JabRef instance. Shutting down."));
Globals.shutdownThreadPools();
// needed to tell JavaFx to stop
Platform.exit();
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/collab/ChangeScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.jabref.JabRefExecutorService;
import org.jabref.gui.BasePanel;
import org.jabref.gui.JabRefFrame;
import org.jabref.logic.bibtex.DuplicateCheck;
import org.jabref.logic.bibtex.comparator.EntryComparator;
import org.jabref.logic.exporter.BibDatabaseWriter;
import org.jabref.logic.exporter.BibtexDatabaseWriter;
Expand All @@ -29,7 +30,6 @@
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.Defaults;
import org.jabref.model.DuplicateCheck;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.database.EntrySorter;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/collab/EntryChange.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import org.jabref.gui.BasePanel;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableFieldChange;
import org.jabref.logic.bibtex.DuplicateCheck;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.DuplicateCheck;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.entry.BibEntry;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/collab/EntryDeleteChange.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import org.jabref.gui.PreviewPanel;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableRemoveEntry;
import org.jabref.logic.bibtex.DuplicateCheck;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.DuplicateCheck;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.entry.BibEntry;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/DuplicateSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.jabref.gui.undo.UndoableInsertEntry;
import org.jabref.gui.undo.UndoableRemoveEntry;
import org.jabref.gui.worker.CallBack;
import org.jabref.logic.bibtex.DuplicateCheck;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.DuplicateCheck;
import org.jabref.model.entry.BibEntry;

import spin.Spin;
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/org/jabref/gui/EntryTypeDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import org.jabref.Globals;
import org.jabref.gui.keyboard.KeyBinding;
import org.jabref.logic.bibtexkeypattern.BibtexKeyPatternUtil;
import org.jabref.logic.importer.FetcherException;
import org.jabref.logic.importer.IdBasedFetcher;
import org.jabref.logic.importer.WebFetchers;
Expand Down Expand Up @@ -96,7 +97,6 @@ private JPanel createEntryGroupsPanel() {
if (!customTypes.isEmpty()) {
panel.add(createEntryGroupPanel(Localization.lang("Custom"), customTypes));
}

} else {
panel.add(createEntryGroupPanel("BibTeX", BibtexEntryTypes.ALL));
panel.add(createEntryGroupPanel("IEEETran", IEEETranEntryTypes.ALL));
Expand Down Expand Up @@ -182,7 +182,7 @@ private JPanel createIdFetcherPanel() {
JPanel jPanel = new JPanel();

GridBagConstraints constraints = new GridBagConstraints();
constraints.insets = new Insets(4,4,4,4);
constraints.insets = new Insets(4, 4, 4, 4);

GridBagLayout layout = new GridBagLayout();
jPanel.setLayout(layout);
Expand Down Expand Up @@ -305,15 +305,19 @@ protected void done() {
try {
Optional<BibEntry> result = get();
if (result.isPresent()) {
frame.getCurrentBasePanel().insertEntry(result.get());
final BibEntry bibEntry = result.get();
// Regenerate CiteKey of imported BibEntry
BibtexKeyPatternUtil.makeAndSetLabel(Globals.prefs.getBibtexKeyPatternPreferences().getKeyPattern(), frame.getCurrentBasePanel().getDatabase(), bibEntry, Globals.prefs.getBibtexKeyPatternPreferences());

frame.getCurrentBasePanel().insertEntry(bibEntry);
dispose();
} else if (searchID.trim().isEmpty()) {
JOptionPane.showMessageDialog(frame, Localization.lang("The given search ID was empty."), Localization.lang("Empty search ID"), JOptionPane.WARNING_MESSAGE);
} else if (!fetcherException) {
JOptionPane.showMessageDialog(frame, Localization.lang("Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.", fetcher.getName(), searchID)+ "\n" + fetcherExceptionMessage, Localization.lang("No files found."), JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(frame, Localization.lang("Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.", fetcher.getName(), searchID) + "\n" + fetcherExceptionMessage, Localization.lang("No files found."), JOptionPane.WARNING_MESSAGE);
} else {
JOptionPane.showMessageDialog(frame,
Localization.lang("Error while fetching from %0", fetcher.getName()) +"." + "\n" + fetcherExceptionMessage,
Localization.lang("Error while fetching from %0", fetcher.getName()) + "." + "\n" + fetcherExceptionMessage,
Localization.lang("Error"), JOptionPane.ERROR_MESSAGE);
}
fetcherWorker = new FetcherWorker();
Expand All @@ -328,5 +332,4 @@ protected void done() {
}
}
}

}
14 changes: 5 additions & 9 deletions src/main/java/org/jabref/gui/FindUnlinkedFilesDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@

/**
* GUI Dialog for the feature "Find unlinked files".
*
* @author Nosh&Dan
* @version 25.11.2008 | 23:13:29
*
*/
public class FindUnlinkedFilesDialog extends JDialog {
private static final Log LOGGER = LogFactory.getLog(FindUnlinkedFilesDialog.class);
Expand Down Expand Up @@ -130,7 +126,7 @@ public class FindUnlinkedFilesDialog extends JDialog {
private JButton buttonClose;
/* Options for the TreeView */
private JButton buttonOptionSelectAll;
private JButton buttonOptionUnselectAll;
private JButton buttonOptionDeselectAll;
private JButton buttonOptionExpandAll;
private JButton buttonOptionCollapseAll;

Expand Down Expand Up @@ -711,9 +707,9 @@ public void windowClosing(WindowEvent e) {
buttonOptionSelectAll = new JButton();
buttonOptionSelectAll.setMnemonic('A');
buttonOptionSelectAll.setAction(actionSelectAll);
buttonOptionUnselectAll = new JButton();
buttonOptionUnselectAll.setMnemonic('U');
buttonOptionUnselectAll.setAction(actionUnselectAll);
buttonOptionDeselectAll = new JButton();
buttonOptionDeselectAll.setMnemonic('U');
buttonOptionDeselectAll.setAction(actionUnselectAll);
buttonOptionExpandAll = new JButton();
buttonOptionExpandAll.setMnemonic('E');
buttonOptionExpandAll.setAction(actionExpandTree);
Expand Down Expand Up @@ -809,7 +805,7 @@ GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST, new Insets(18, 3, 18, 6)
GridBagConstraints.NORTHEAST, basicInsets, 1, 1, 1, 1, 0, 0, 0, 0);
FindUnlinkedFilesDialog.addComponent(gbl, panelOptions, buttonOptionSelectAll, GridBagConstraints.HORIZONTAL,
GridBagConstraints.NORTH, noInsets, 0, 0, 1, 1, 1, 0, 0, 0);
FindUnlinkedFilesDialog.addComponent(gbl, panelOptions, buttonOptionUnselectAll, GridBagConstraints.HORIZONTAL,
FindUnlinkedFilesDialog.addComponent(gbl, panelOptions, buttonOptionDeselectAll, GridBagConstraints.HORIZONTAL,
GridBagConstraints.NORTH, noInsets, 0, 1, 1, 1, 0, 0, 0, 0);
FindUnlinkedFilesDialog.addComponent(gbl, panelOptions, buttonOptionExpandAll, GridBagConstraints.HORIZONTAL,
GridBagConstraints.NORTH, new Insets(6, 0, 0, 0), 0, 2, 1, 1, 0, 0, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ private void fillMenu() {
quality.add(findUnlinkedFiles);
quality.add(autoLinkFile);

for (IdFetcher fetcher : WebFetchers.getIdFetchers()) {
for (IdFetcher fetcher : WebFetchers.getIdFetchers(Globals.prefs.getImportFormatPreferences())) {
lookupIdentifiers.add(new LookupIdentifierAction(this, fetcher));
}
quality.add(lookupIdentifiers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import org.jabref.gui.undo.UndoableRemoveEntry;
import org.jabref.gui.util.comparator.IconComparator;
import org.jabref.gui.util.component.CheckBoxMessage;
import org.jabref.logic.bibtex.DuplicateCheck;
import org.jabref.logic.bibtex.comparator.FieldComparator;
import org.jabref.logic.bibtexkeypattern.BibtexKeyPatternUtil;
import org.jabref.logic.help.HelpFile;
Expand All @@ -83,7 +84,6 @@
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.util.UpdateField;
import org.jabref.model.Defaults;
import org.jabref.model.DuplicateCheck;
import org.jabref.model.FieldChange;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.database.BibDatabaseContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public CheckableTreeNode searchDirectory(File directory, FileFilter filter) {
* resolve its recursion and return what it has saved so far.
*/
public CheckableTreeNode searchDirectory(File directory, UnlinkedPDFFileFilter ff, AtomicBoolean state, ChangeListener changeListener) {
/* Cancelation of the search from outside! */
/* Cancellation of the search from outside! */
if ((state == null) || !state.get()) {
return null;
}
Expand Down

This file was deleted.

Loading

0 comments on commit c9eeefd

Please sign in to comment.