diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index 2f80b63ca547..8c99571dd2e7 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -106,8 +106,7 @@ public class LibraryTab extends Tab { private SuggestionProviders suggestionProviders; - @SuppressWarnings({"FieldCanBeLocal"}) - private Subscription dividerPositionSubscription; + @SuppressWarnings({"FieldCanBeLocal"}) private Subscription dividerPositionSubscription; // the query the user searches when this BasePanel is active private Optional currentSearchQuery = Optional.empty(); @@ -161,8 +160,7 @@ public LibraryTab(BibDatabaseContext bibDatabaseContext, Platform.runLater(() -> { EasyBind.subscribe(changedProperty, this::updateTabTitle); - stateManager.getOpenDatabases().addListener((ListChangeListener) c -> - updateTabTitle(changedProperty.getValue())); + stateManager.getOpenDatabases().addListener((ListChangeListener) c -> updateTabTitle(changedProperty.getValue())); }); } @@ -277,8 +275,7 @@ public void feedData(BibDatabaseContext bibDatabaseContextFromParserResult) { Platform.runLater(() -> { EasyBind.subscribe(changedProperty, this::updateTabTitle); - stateManager.getOpenDatabases().addListener((ListChangeListener) c -> - updateTabTitle(changedProperty.getValue())); + stateManager.getOpenDatabases().addListener((ListChangeListener) c -> updateTabTitle(changedProperty.getValue())); }); installAutosaveManagerAndBackupManager(); @@ -297,8 +294,8 @@ public void installAutosaveManagerAndBackupManager() { private boolean isDatabaseReadyForAutoSave(BibDatabaseContext context) { return ((context.getLocation() == DatabaseLocation.SHARED) || ((context.getLocation() == DatabaseLocation.LOCAL) - && preferencesService.getLibraryPreferences().shouldAutoSave())) - && context.getDatabasePath().isPresent(); + && preferencesService.getLibraryPreferences().shouldAutoSave())) + && context.getDatabasePath().isPresent(); } private boolean isDatabaseReadyForBackup(BibDatabaseContext context) { @@ -470,8 +467,8 @@ public void insertEntries(final List entries) { // Set owner and timestamp UpdateField.setAutomaticFields(entries, - preferencesService.getOwnerPreferences(), - preferencesService.getTimestampPreferences()); + preferencesService.getOwnerPreferences(), + preferencesService.getTimestampPreferences()); // Create an UndoableInsertEntries object. getUndoManager().addEdit(new UndoableInsertEntries(bibDatabaseContext.getDatabase(), entries)); @@ -494,15 +491,15 @@ public void editEntryAndFocusField(BibEntry entry, Field field) { private void createMainTable() { mainTable = new MainTable(tableModel, - this, - bibDatabaseContext, - preferencesService, - dialogService, - stateManager, - Globals.getKeyPrefs(), - Globals.getClipboardManager(), - Globals.TASK_EXECUTOR, - fileUpdateMonitor); + this, + bibDatabaseContext, + preferencesService, + dialogService, + stateManager, + Globals.getKeyPrefs(), + Globals.getClipboardManager(), + Globals.TASK_EXECUTOR, + fileUpdateMonitor); // Add the listener that binds selection to state manager (TODO: should be replaced by proper JavaFX binding as soon as table is implemented in JavaFX) mainTable.addSelectionListener(listEvent -> stateManager.setSelectedEntries(mainTable.getSelectedEntries())); @@ -677,11 +674,11 @@ private boolean showDeleteConfirmationDialog(int numberOfEntries) { } return dialogService.showConfirmationDialogWithOptOutAndWait(title, - message, - okButton, - cancelButton, - Localization.lang("Do not ask again"), - optOut -> preferencesService.getWorkspacePreferences().setConfirmDelete(!optOut)); + message, + okButton, + cancelButton, + Localization.lang("Do not ask again"), + optOut -> preferencesService.getWorkspacePreferences().setConfirmDelete(!optOut)); } else { return true; } @@ -764,11 +761,11 @@ public FileAnnotationCache getAnnotationCache() { public void resetChangeMonitor() { changeMonitor.ifPresent(DatabaseChangeMonitor::unregister); changeMonitor = Optional.of(new DatabaseChangeMonitor(bibDatabaseContext, - fileUpdateMonitor, - Globals.TASK_EXECUTOR, - dialogService, - preferencesService, - databaseNotificationPane)); + fileUpdateMonitor, + Globals.TASK_EXECUTOR, + dialogService, + preferencesService, + databaseNotificationPane)); } public void copy() { @@ -851,7 +848,7 @@ public void listen(EntriesAddedEvent addedEntriesEvent) { // Automatically add new entries to the selected group (or set of groups) if (preferencesService.getGroupsPreferences().shouldAutoAssignGroup()) { stateManager.getSelectedGroup(bibDatabaseContext).forEach( - selectedGroup -> selectedGroup.addEntriesToGroup(addedEntriesEvent.getBibEntries())); + selectedGroup -> selectedGroup.addEntriesToGroup(addedEntriesEvent.getBibEntries())); } } } @@ -944,6 +941,7 @@ public IndexingTaskManager getIndexingTaskManager() { } public static class DatabaseNotification extends NotificationPane { + public DatabaseNotification(Node content) { super(content); }