diff --git a/.gitignore b/.gitignore index eef074f6e45..39f4c1f4ac2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,14 @@ status.md # Install4J install4j6/ +# Snap +parts/ +stage/ +prime/ +*.snap +jabref_source.tar.bz2 +snap/.snapcraft/ + # Gradle # generated when `gradlew --gui` is called ui/ @@ -23,18 +31,6 @@ ui/ jabref.xml *.sonargraph -# Snapcraft - JabRef places the files into buildres/snapcraft -snap/ - - - - - - - - - - # Created by https://www.gitignore.io/api/gradle,java,jabref,intellij,eclipse,netbeans,windows,linux,macos,node,snapcraft ### Eclipse ### diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c29a663c2b..26e4ebbf307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We updated updated the Related Articles tab to accept JSON from the new version of the Mr. DLib service - We added an option in the preference dialog box that allows user to choose behavior after dragging and dropping files in Entry Editor. [#4356](https://github.com/JabRef/jabref/issues/4356) - We added the ability to have an export preference where previously "File"-->"Export"/"Export selected entries" would not save the user's preference[#4495](https://github.com/JabRef/jabref/issues/4495) +- For automatically created groups, added ability to filter groups by entry type. [#4539](https://github.com/JabRef/jabref/issues/4539) - We added the ability to add field names from the Preferences Dialog [#4546](https://github.com/JabRef/jabref/issues/4546) - We added the ability change the column widths directly in the main table. [#4546](https://github.com/JabRef/jabref/issues/4546) - We added the ability to execute default action in dialog by using with Ctrl + Enter combination [#4496](https://github.com/JabRef/jabref/issues/4496) diff --git a/build.gradle b/build.gradle index 94a5e380cab..1e55cfe71cc 100644 --- a/build.gradle +++ b/build.gradle @@ -102,7 +102,7 @@ dependencies { compile group: 'org.apache.tika', name: 'tika-core', version: '1.20' // required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635 - compile 'org.bouncycastle:bcprov-jdk15on:1.60' + compile 'org.bouncycastle:bcprov-jdk15on:1.61' compile 'commons-cli:commons-cli:1.4' @@ -120,7 +120,7 @@ dependencies { antlr4 'org.antlr:antlr4:4.7.2' compile 'org.antlr:antlr4-runtime:4.7.2' - compile 'mysql:mysql-connector-java:8.0.14' + compile 'mysql:mysql-connector-java:8.0.15' compile 'org.postgresql:postgresql:42.2.5' @@ -147,10 +147,10 @@ dependencies { // >1.8.0-beta is required for java 9 compatibility compile 'org.slf4j:slf4j-api:1.8.0-beta2' - compile 'org.apache.logging.log4j:log4j-slf4j18-impl:2.11.1' - compile 'org.apache.logging.log4j:log4j-jcl:2.11.1' - compile 'org.apache.logging.log4j:log4j-api:2.11.1' - compile 'org.apache.logging.log4j:log4j-core:2.11.1' + compile 'org.apache.logging.log4j:log4j-slf4j18-impl:2.11.2' + compile 'org.apache.logging.log4j:log4j-jcl:2.11.2' + compile 'org.apache.logging.log4j:log4j-api:2.11.2' + compile 'org.apache.logging.log4j:log4j-core:2.11.2' compile 'de.undercouch:citeproc-java:1.0.1' @@ -158,21 +158,18 @@ dependencies { errorproneJavac 'com.google.errorprone:javac:1.8.0-u20' - compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.3.0' - compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.3.0' + compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.3.1' + compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.3.1' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.2' - testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.2' - testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.2' - testCompile 'org.junit.platform:junit-platform-launcher:1.3.2' + testImplementation 'org.junit.jupiter:junit-jupiter:5.4.0' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.4.0' + testCompile 'org.junit.platform:junit-platform-launcher:1.4.0' - testCompile 'org.junit-pioneer:junit-pioneer:0.3.0' testRuntime 'org.apache.logging.log4j:log4j-core:2.11.1' - testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.1' - testCompile 'org.mockito:mockito-core:2.23.4' - testCompile 'com.github.tomakehurst:wiremock:2.20.0' - testCompile 'org.assertj:assertj-swing-junit:3.8.0' + testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.2' + testCompile 'org.mockito:mockito-core:2.24.0' + testCompile 'com.github.tomakehurst:wiremock:2.21.0' + testCompile 'org.assertj:assertj-swing-junit:3.9.2' testCompile 'org.reflections:reflections:0.9.11' testCompile 'org.xmlunit:xmlunit-core:2.6.2' testCompile 'org.xmlunit:xmlunit-matchers:2.6.2' @@ -181,7 +178,7 @@ dependencies { testCompile "org.testfx:testfx-core:4.0.+" testCompile "org.testfx:testfx-junit5:4.0.+" - checkstyle 'com.puppycrawl.tools:checkstyle:8.16' + checkstyle 'com.puppycrawl.tools:checkstyle:8.17' } jacoco { @@ -192,9 +189,6 @@ dependencyUpdates { outputFormatter = "json" } -//We have to use this as long as junit-pioneer has no official release -dependencyUpdates.revision = 'integration' - // We have some dependencies which cannot be updated due to various reasons. dependencyUpdates.resolutionStrategy = { componentSelection { rules -> diff --git a/buildres/snapcraft/jabref.desktop b/snap/gui/jabref.desktop similarity index 90% rename from buildres/snapcraft/jabref.desktop rename to snap/gui/jabref.desktop index ef63a896d2d..3444b73fc8a 100644 --- a/buildres/snapcraft/jabref.desktop +++ b/snap/gui/jabref.desktop @@ -4,7 +4,7 @@ GenericName=BibTeX Editor Comment=JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. Type=Application Terminal=false -Icon=${SNAP}/meta/gui/JabRef-icon-256.png +Icon=${SNAP}/meta/gui/jabref.png Exec=jabref %U Keywords=bibtex;biblatex;latex;bibliography Categories=Office; diff --git a/buildres/snapcraft/JabRef-icon-256.png b/snap/gui/jabref.png similarity index 100% rename from buildres/snapcraft/JabRef-icon-256.png rename to snap/gui/jabref.png diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 00000000000..b26f84fef0d --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,41 @@ +name: jabref +version: "git" +version-script: cat build.gradle | grep "^version =" | cut -d'"' -f2 +#icon: snap/gui/jabref.png +summary: Bibliography manager +description: JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. + +grade: devel +confinement: strict + +architectures: + - build-on: amd64 + - build-on: i386 + +apps: + jabref: + command: desktop-launch java -jar $SNAP/jar/JabRef-$SNAP_VERSION.jar + environment: + _JAVA_OPTIONS: "-Duser.home=$SNAP_USER_DATA" + plugs: + - desktop + - desktop-legacy + - wayland + - unity7 + - home + - opengl + - network-bind + - removable-media + +parts: + jabref: + plugin: gradle + source: . + source-type: git + stage-packages: + - openjdk-8-jre + - openjfx + - x11-utils + gradle-options: [snapJar, -xtest] + gradle-output-dir: 'build/releases' + after: [desktop-gtk2] diff --git a/snapcraft.yaml b/snapcraft.yaml deleted file mode 100644 index 0daa48c83c4..00000000000 --- a/snapcraft.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# based on https://github.com/snapcore/snapcraft/blob/master/demos/gradle/snap/snapcraft.yaml - -name: jabref - -# the version string 4.2-dev is replaced by scripts/run-snapcraft.sh with the current version provided in build.gradle -version: '4.2-dev' - -summary: Bibliography manager -icon: buildres/snapcraft/JabRef-icon-256.png -description: JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. - -# only with the following set to stable + strict, we can do a full release - -# see https://snapcraft.io/docs/reference/channels -# stable | devel -grade: devel - -# see https://snapcraft.io/docs/reference/confinement -# strict | devmode -confinement: strict - -apps: - jabref: - command: desktop-launch java -jar $SNAP/jar/JabRef-4.2-dev.jar - plugs: [desktop, desktop-legacy, wayland, unity7, home, network-bind] - desktop: ../buildres/snapcraft/jabref.desktop - -parts: - jabref: - plugin: gradle - source: . - stage-packages: [default-jre, openjfx, x11-utils] - gradle-options: [snapJar] - gradle-output-dir: 'build/releases' - after: [desktop-gtk3] diff --git a/src/main/java/org/jabref/gui/DuplicateResolverDialog.java b/src/main/java/org/jabref/gui/DuplicateResolverDialog.java index cb34df3d202..0be0d823c83 100644 --- a/src/main/java/org/jabref/gui/DuplicateResolverDialog.java +++ b/src/main/java/org/jabref/gui/DuplicateResolverDialog.java @@ -68,7 +68,7 @@ private void init(BibEntry one, BibEntry two, DuplicateResolverType type) { second = new ButtonType(Localization.lang("Remove entry from import"), ButtonData.APPLY); both = new ButtonType(Localization.lang("Keep both"), ButtonData.APPLY); me = new MergeEntries(one, two, Localization.lang("Old entry"), - Localization.lang("From import"), frame.getCurrentBasePanel().getBibDatabaseContext().getMode()); + Localization.lang("From import"), frame.getCurrentBasePanel().getBibDatabaseContext().getMode()); break; case DUPLICATE_SEARCH_WITH_EXACT: first = new ButtonType(Localization.lang("Keep left"), ButtonData.APPLY); @@ -84,7 +84,7 @@ private void init(BibEntry one, BibEntry two, DuplicateResolverType type) { second = new ButtonType(Localization.lang("Do not import entry"), ButtonData.APPLY); both = new ButtonType(Localization.lang("Import and keep old entry"), ButtonData.APPLY); me = new MergeEntries(one, two, Localization.lang("Old entry"), - Localization.lang("From import"), frame.getCurrentBasePanel().getBibDatabaseContext().getMode()); + Localization.lang("From import"), frame.getCurrentBasePanel().getBibDatabaseContext().getMode()); break; } if (removeExactVisible) { diff --git a/src/main/java/org/jabref/gui/DuplicateSearch.java b/src/main/java/org/jabref/gui/DuplicateSearch.java index 476b3f70276..9e9921f741a 100644 --- a/src/main/java/org/jabref/gui/DuplicateSearch.java +++ b/src/main/java/org/jabref/gui/DuplicateSearch.java @@ -127,7 +127,7 @@ private void askResolveStrategy(DuplicateSearchResult result, BibEntry first, Bi DuplicateResolverResult resolverResult = dialog.showAndWait().orElse(DuplicateResolverResult.BREAK); if ((resolverResult == DuplicateResolverResult.KEEP_LEFT) - || (resolverResult == DuplicateResolverResult.AUTOREMOVE_EXACT)) { + || (resolverResult == DuplicateResolverResult.AUTOREMOVE_EXACT)) { result.remove(second); if (resolverResult == DuplicateResolverResult.AUTOREMOVE_EXACT) { autoRemoveExactDuplicates.set(true); // Remember choice @@ -167,7 +167,7 @@ private void handleDuplicates(DuplicateSearchResult result) { } dialogService.notify(Localization.lang("Duplicates found") + ": " + duplicateCount.get() + ' ' - + Localization.lang("pairs processed") + ": " + result.getDuplicateCount()); + + Localization.lang("pairs processed") + ": " + result.getDuplicateCount()); compoundEdit.end(); panel.getUndoManager().addEdit(compoundEdit); diff --git a/src/main/java/org/jabref/gui/EntryType.fxml b/src/main/java/org/jabref/gui/EntryType.fxml index 7fb864fdf78..0ed5f37b502 100644 --- a/src/main/java/org/jabref/gui/EntryType.fxml +++ b/src/main/java/org/jabref/gui/EntryType.fxml @@ -12,41 +12,43 @@ - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - @@ -56,11 +58,11 @@ - - + + - - + + diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 82ef76ff085..354c2830a35 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -923,7 +923,7 @@ private MenuBar createMenu() { ); options.getItems().addAll( - factory.createMenuItem(StandardActions.SHOW_PREFS, new ShowPreferencesAction(this)), + factory.createMenuItem(StandardActions.SHOW_PREFS, new ShowPreferencesAction(this, Globals.TASK_EXECUTOR)), new SeparatorMenuItem(), @@ -939,8 +939,7 @@ private MenuBar createMenu() { factory.createMenuItem(StandardActions.MANAGE_CONTENT_SELECTORS, new OldDatabaseCommandWrapper(Actions.MANAGE_SELECTORS, this, Globals.stateManager)), factory.createMenuItem(StandardActions.CUSTOMIZE_ENTRY_TYPES, new CustomizeEntryAction(this)), - factory.createMenuItem(StandardActions.MANAGE_CITE_KEY_PATTERNS, new BibtexKeyPatternAction(this)) - ); + factory.createMenuItem(StandardActions.MANAGE_CITE_KEY_PATTERNS, new BibtexKeyPatternAction(this))); help.getItems().addAll( factory.createMenuItem(StandardActions.HELP, HelpAction.getMainHelpPageCommand()), diff --git a/src/main/java/org/jabref/gui/PreviewPanel.java b/src/main/java/org/jabref/gui/PreviewPanel.java index bffcb4e2bd3..796fafdd016 100644 --- a/src/main/java/org/jabref/gui/PreviewPanel.java +++ b/src/main/java/org/jabref/gui/PreviewPanel.java @@ -24,7 +24,7 @@ import javafx.scene.web.WebView; import org.jabref.Globals; -import org.jabref.gui.externalfiles.NewDroppedFileHandler; +import org.jabref.gui.externalfiles.ExternalFilesEntryLinker; import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.keyboard.KeyBinding; @@ -61,8 +61,9 @@ public class PreviewPanel extends ScrollPane implements SearchQueryHighlightList private final DialogService dialogService; private final KeyBindingRepository keyBindingRepository; - private String previewStyle; private final String defaultPreviewStyle = "Preview"; + private String previewStyle; + private CitationStyle citationStyle; private Optional basePanel = Optional.empty(); private boolean fixedLayout; @@ -79,7 +80,7 @@ public class PreviewPanel extends ScrollPane implements SearchQueryHighlightList private final WebView previewView; private Optional> citationStyleFuture = Optional.empty(); - private final NewDroppedFileHandler fileHandler; + private final ExternalFilesEntryLinker fileLinker; /** * @param panel (may be null) Only set this if the preview is associated to the main window. @@ -92,11 +93,7 @@ public PreviewPanel(BasePanel panel, BibDatabaseContext databaseContext, KeyBind this.clipBoardManager = Globals.clipboardManager; this.keyBindingRepository = keyBindingRepository; - fileHandler = new NewDroppedFileHandler(dialogService, databaseContext, externalFileTypes, - Globals.prefs.getFilePreferences(), - Globals.prefs.getImportFormatPreferences(), - Globals.prefs.getUpdateFieldPreferences(), - Globals.getFileUpdateMonitor()); + fileLinker = new ExternalFilesEntryLinker(externalFileTypes, Globals.prefs.getFilePreferences(), databaseContext); // Set up scroll pane for preview pane setFitToHeight(true); @@ -134,19 +131,18 @@ public PreviewPanel(BasePanel panel, BibDatabaseContext databaseContext, KeyBind List files = event.getDragboard().getFiles().stream().map(File::toPath).collect(Collectors.toList()); if (event.getTransferMode() == TransferMode.MOVE) { - LOGGER.debug("Mode MOVE"); //shift on win or no modifier - fileHandler.addToEntryRenameAndMoveToFileDir(entry, files); + fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); } if (event.getTransferMode() == TransferMode.LINK) { LOGGER.debug("Node LINK"); //alt on win - fileHandler.addToEntry(entry, files); - + fileLinker.addFilesToEntry(entry, files); } if (event.getTransferMode() == TransferMode.COPY) { LOGGER.debug("Mode Copy"); //ctrl on win, no modifier on Xubuntu - fileHandler.copyFilesToFileDirAndAddToEntry(entry, files); + fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); } + success = true; } event.setDropCompleted(success); @@ -224,24 +220,25 @@ private void updateLayout(PreviewPreferences previewPreferences, boolean init) { String style = previewPreferences.getCurrentPreviewStyle(); if (previewStyle == null) { previewStyle = style; + CitationStyle.createCitationStyleFromFile(style).ifPresent(cs -> citationStyle = cs); } if (basePanel.isPresent() && !previewStyle.equals(style)) { if (CitationStyle.isCitationStyleFile(style)) { layout = Optional.empty(); CitationStyle.createCitationStyleFromFile(style) - .ifPresent(citationStyle -> { - basePanel.get().getCitationStyleCache().setCitationStyle(citationStyle); - if (!init) { - basePanel.get().output(Localization.lang("Preview style changed to: %0", citationStyle.getTitle())); - } - }); + .ifPresent(cs -> { + citationStyle = cs; + if (!init) { + basePanel.get().output(Localization.lang("Preview style changed to: %0", citationStyle.getTitle())); + } + }); previewStyle = style; - } else { - previewStyle = defaultPreviewStyle; - updatePreviewLayout(previewPreferences.getPreviewStyle(), previewPreferences.getLayoutFormatterPreferences()); - if (!init) { - basePanel.get().output(Localization.lang("Preview style changed to: %0", Localization.lang("Preview"))); - } + } + } else { + previewStyle = defaultPreviewStyle; + updatePreviewLayout(previewPreferences.getPreviewStyle(), previewPreferences.getLayoutFormatterPreferences()); + if (!init) { + basePanel.get().output(Localization.lang("Preview style changed to: %0", Localization.lang("Preview"))); } } @@ -299,6 +296,9 @@ public void update() { .doLayout(entry, databaseContext.getDatabase()))); setPreviewLabel(sb.toString()); } else if (basePanel.isPresent() && bibEntry.isPresent()) { + if ((citationStyle != null) && !previewStyle.equals(defaultPreviewStyle)) { + basePanel.get().getCitationStyleCache().setCitationStyle(citationStyle); + } Future citationStyleWorker = BackgroundTask .wrap(() -> basePanel.get().getCitationStyleCache().getCitationFor(bibEntry.get())) .onRunning(() -> { @@ -363,11 +363,13 @@ public void close() { private void copyPreviewToClipBoard() { StringBuilder previewStringContent = new StringBuilder(); Document document = previewView.getEngine().getDocument(); - NodeList nodeList = document.getElementsByTagName("*"); + NodeList nodeList = document.getElementsByTagName("html"); + + //Nodelist does not implement iterable for (int i = 0; i < nodeList.getLength(); i++) { Element element = (Element) nodeList.item(i); - previewStringContent.append(element.getNodeValue()).append("\n"); + previewStringContent.append(element.getTextContent()); } ClipboardContent content = new ClipboardContent(); diff --git a/src/main/java/org/jabref/gui/SidePaneManager.java b/src/main/java/org/jabref/gui/SidePaneManager.java index eef7f01098b..173a11a07c3 100644 --- a/src/main/java/org/jabref/gui/SidePaneManager.java +++ b/src/main/java/org/jabref/gui/SidePaneManager.java @@ -31,10 +31,10 @@ public SidePaneManager(JabRefPreferences preferences, JabRefFrame frame) { OpenOfficePreferences openOfficePreferences = preferences.getOpenOfficePreferences(); Stream.of( - new FileUpdatePanel(this), - new GroupSidePane(this, preferences, frame.getDialogService()), - new WebSearchPane(this, preferences, frame), - new OpenOfficeSidePanel(this, preferences, frame)) + new FileUpdatePanel(this), + new GroupSidePane(this, preferences, frame.getDialogService()), + new WebSearchPane(this, preferences, frame), + new OpenOfficeSidePanel(this, preferences, frame)) .forEach(pane -> components.put(pane.getType(), pane)); if (preferences.getBoolean(JabRefPreferences.GROUP_SIDEPANE_VISIBLE)) { diff --git a/src/main/java/org/jabref/gui/actions/ShowPreferencesAction.java b/src/main/java/org/jabref/gui/actions/ShowPreferencesAction.java index 7c13cbcc250..e6c0a29684c 100644 --- a/src/main/java/org/jabref/gui/actions/ShowPreferencesAction.java +++ b/src/main/java/org/jabref/gui/actions/ShowPreferencesAction.java @@ -2,17 +2,21 @@ import org.jabref.gui.JabRefFrame; import org.jabref.gui.preferences.PreferencesDialog; +import org.jabref.gui.util.TaskExecutor; public class ShowPreferencesAction extends SimpleCommand { private final JabRefFrame jabRefFrame; - public ShowPreferencesAction(JabRefFrame jabRefFrame) { + private final TaskExecutor taskExecutor; + + public ShowPreferencesAction(JabRefFrame jabRefFrame, TaskExecutor taskExecutor) { this.jabRefFrame = jabRefFrame; + this.taskExecutor = taskExecutor; } @Override public void execute() { - PreferencesDialog preferencesDialog = new PreferencesDialog(jabRefFrame); + PreferencesDialog preferencesDialog = new PreferencesDialog(jabRefFrame, taskExecutor); preferencesDialog.showAndWait(); } } diff --git a/src/main/java/org/jabref/gui/bibtexkeypattern/ResolveDuplicateLabelDialog.java b/src/main/java/org/jabref/gui/bibtexkeypattern/ResolveDuplicateLabelDialog.java index 68006125528..f6c6aa5544c 100644 --- a/src/main/java/org/jabref/gui/bibtexkeypattern/ResolveDuplicateLabelDialog.java +++ b/src/main/java/org/jabref/gui/bibtexkeypattern/ResolveDuplicateLabelDialog.java @@ -48,7 +48,7 @@ public ResolveDuplicateLabelDialog(BasePanel panel, String key, List e diag = new JDialog((JFrame) null, Localization.lang("Duplicate BibTeX key"), true); FormBuilder b = FormBuilder.create().layout(new FormLayout( - "left:pref, 4dlu, fill:pref", "p")); + "left:pref, 4dlu, fill:pref", "p")); b.add(new JLabel(Localization.lang("Duplicate BibTeX key") + ": " + key)).xyw(1, 1, 3); b.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); diff --git a/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java b/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java index ee562c53401..0938f717905 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java @@ -112,7 +112,6 @@ protected List call() throws InterruptedException, writeLogMessage(newFile, bw, localizedErrorMessage); addResultToList(newFile, success, localizedErrorMessage); } - } } diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java index 4289c29d1b2..450da9e98d9 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java @@ -31,7 +31,7 @@ import org.jabref.gui.actions.GenerateBibtexKeySingleAction; import org.jabref.gui.actions.StandardActions; import org.jabref.gui.entryeditor.fileannotationtab.FileAnnotationTab; -import org.jabref.gui.externalfiles.NewDroppedFileHandler; +import org.jabref.gui.externalfiles.ExternalFilesEntryLinker; import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.gui.help.HelpAction; import org.jabref.gui.keyboard.KeyBinding; @@ -91,7 +91,7 @@ public class EntryEditor extends BorderPane { private final EntryEditorPreferences preferences; private final DialogService dialogService; - private final NewDroppedFileHandler fileHandler; + private final ExternalFilesEntryLinker fileLinker; private final TaskExecutor taskExecutor; public EntryEditor(BasePanel panel, EntryEditorPreferences preferences, FileUpdateMonitor fileMonitor, DialogService dialogService, ExternalFileTypes externalFileTypes, TaskExecutor taskExecutor) { @@ -103,11 +103,7 @@ public EntryEditor(BasePanel panel, EntryEditorPreferences preferences, FileUpda this.dialogService = dialogService; this.taskExecutor = taskExecutor; - fileHandler = new NewDroppedFileHandler(dialogService, databaseContext, externalFileTypes, - Globals.prefs.getFilePreferences(), - Globals.prefs.getImportFormatPreferences(), - Globals.prefs.getUpdateFieldPreferences(), - Globals.getFileUpdateMonitor()); + fileLinker = new ExternalFilesEntryLinker(externalFileTypes, Globals.prefs.getFilePreferences(), databaseContext); ViewLoader.view(this) .root(this) @@ -151,17 +147,17 @@ public EntryEditor(BasePanel panel, EntryEditorPreferences preferences, FileUpda if (event.getTransferMode() == TransferMode.LINK) //alt on win { LOGGER.debug("Mode LINK"); - fileHandler.addToEntry(entry, files); + fileLinker.addFilesToEntry(entry, files); } else if (event.getTransferMode() == TransferMode.COPY) //ctrl on win, no modifier on Xubuntu { LOGGER.debug("Mode COPY"); - fileHandler.copyFilesToFileDirAndAddToEntry(entry, files); + fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); } else { LOGGER.debug("Mode MOVE"); //shift on win or no modifier - fileHandler.addToEntryRenameAndMoveToFileDir(entry, files); + fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); } } @@ -170,17 +166,17 @@ else if (event.getTransferMode() == TransferMode.COPY) //ctrl on win, no modifie if (event.getTransferMode() == TransferMode.COPY) //ctrl on win, no modifier on Xubuntu { LOGGER.debug("Mode MOVE"); - fileHandler.addToEntryRenameAndMoveToFileDir(entry, files); + fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); } else if (event.getTransferMode() == TransferMode.LINK) //alt on win { LOGGER.debug("Mode LINK"); - fileHandler.addToEntry(entry, files); + fileLinker.addFilesToEntry(entry, files); } else { LOGGER.debug("Mode COPY"); //shift on win or no modifier - fileHandler.copyFilesToFileDirAndAddToEntry(entry, files); + fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); } } @@ -189,17 +185,17 @@ else if (event.getTransferMode() == TransferMode.LINK) //alt on win if (event.getTransferMode() == TransferMode.COPY) //ctrl on win, no modifier on Xubuntu { LOGGER.debug("Mode COPY"); - fileHandler.copyFilesToFileDirAndAddToEntry(entry, files); + fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); } else if (event.getTransferMode() == TransferMode.LINK) //alt on win { LOGGER.debug("Mode MOVE"); - fileHandler.addToEntryRenameAndMoveToFileDir(entry, files); + fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); } else { LOGGER.debug("Mode LINK"); //shift on win or no modifier - fileHandler.addToEntry(entry, files); + fileLinker.addFilesToEntry(entry, files); } } } diff --git a/src/main/java/org/jabref/gui/entryeditor/SourceTab.java b/src/main/java/org/jabref/gui/entryeditor/SourceTab.java index b96fed0bea4..397e3abd921 100644 --- a/src/main/java/org/jabref/gui/entryeditor/SourceTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/SourceTab.java @@ -120,7 +120,7 @@ protected void bindToEntry(BibEntry entry) { } catch (IOException ex) { codeArea.setEditable(false); codeArea.appendText(ex.getMessage() + "\n\n" + - Localization.lang("Correct the entry, and reopen editor to display/edit source.")); + Localization.lang("Correct the entry, and reopen editor to display/edit source.")); LOGGER.debug("Incorrect entry", ex); } }); diff --git a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialog.fxml b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialog.fxml index 1c63d7e8008..64a4beed541 100644 --- a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialog.fxml +++ b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialog.fxml @@ -10,43 +10,45 @@ - - + - - - - - - - - - - - - - - - - - -