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 76e14c8e6ce..8e4ca768b05 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -923,23 +923,23 @@ private MenuBar createMenu() { ); options.getItems().addAll( - factory.createMenuItem(StandardActions.SHOW_PREFS, new ShowPreferencesAction(this, Globals.TASK_EXECUTOR)), + factory.createMenuItem(StandardActions.SHOW_PREFS, new ShowPreferencesAction(this, Globals.TASK_EXECUTOR)), - new SeparatorMenuItem(), + new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.SETUP_GENERAL_FIELDS, new SetupGeneralFieldsAction()), - factory.createMenuItem(StandardActions.MANAGE_CUSTOM_IMPORTS, new ManageCustomImportsAction()), - factory.createMenuItem(StandardActions.MANAGE_CUSTOM_EXPORTS, new ManageCustomExportsAction()), - factory.createMenuItem(StandardActions.MANAGE_EXTERNAL_FILETYPES, new EditExternalFileTypesAction()), - factory.createMenuItem(StandardActions.MANAGE_JOURNALS, new ManageJournalsAction()), - factory.createMenuItem(StandardActions.CUSTOMIZE_KEYBINDING, new CustomizeKeyBindingAction()), - factory.createMenuItem(StandardActions.MANAGE_PROTECTED_TERMS, new ManageProtectedTermsAction(this, Globals.protectedTermsLoader)), + factory.createMenuItem(StandardActions.SETUP_GENERAL_FIELDS, new SetupGeneralFieldsAction()), + factory.createMenuItem(StandardActions.MANAGE_CUSTOM_IMPORTS, new ManageCustomImportsAction()), + factory.createMenuItem(StandardActions.MANAGE_CUSTOM_EXPORTS, new ManageCustomExportsAction()), + factory.createMenuItem(StandardActions.MANAGE_EXTERNAL_FILETYPES, new EditExternalFileTypesAction()), + factory.createMenuItem(StandardActions.MANAGE_JOURNALS, new ManageJournalsAction()), + factory.createMenuItem(StandardActions.CUSTOMIZE_KEYBINDING, new CustomizeKeyBindingAction()), + factory.createMenuItem(StandardActions.MANAGE_PROTECTED_TERMS, new ManageProtectedTermsAction(this, Globals.protectedTermsLoader)), - new SeparatorMenuItem(), + new SeparatorMenuItem(), - 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_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))); 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 ff8d6db01bd..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,9 +61,9 @@ public class PreviewPanel extends ScrollPane implements SearchQueryHighlightList private final DialogService dialogService; private final KeyBindingRepository keyBindingRepository; + private final String defaultPreviewStyle = "Preview"; private String previewStyle; private CitationStyle citationStyle; - private final String defaultPreviewStyle = "Preview"; private Optional basePanel = Optional.empty(); private boolean fixedLayout; @@ -80,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. @@ -93,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); @@ -135,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); 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/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 @@ - - + - - - - - - - - - - - - - - - - - -