Skip to content

Commit

Permalink
checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr committed Jun 16, 2023
1 parent ae4e0e4 commit 750a5c0
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<SearchQuery> currentSearchQuery = Optional.empty();
Expand Down Expand Up @@ -161,8 +160,7 @@ public LibraryTab(BibDatabaseContext bibDatabaseContext,

Platform.runLater(() -> {
EasyBind.subscribe(changedProperty, this::updateTabTitle);
stateManager.getOpenDatabases().addListener((ListChangeListener<BibDatabaseContext>) c ->
updateTabTitle(changedProperty.getValue()));
stateManager.getOpenDatabases().addListener((ListChangeListener<BibDatabaseContext>) c -> updateTabTitle(changedProperty.getValue()));
});
}

Expand Down Expand Up @@ -277,8 +275,7 @@ public void feedData(BibDatabaseContext bibDatabaseContextFromParserResult) {

Platform.runLater(() -> {
EasyBind.subscribe(changedProperty, this::updateTabTitle);
stateManager.getOpenDatabases().addListener((ListChangeListener<BibDatabaseContext>) c ->
updateTabTitle(changedProperty.getValue()));
stateManager.getOpenDatabases().addListener((ListChangeListener<BibDatabaseContext>) c -> updateTabTitle(changedProperty.getValue()));
});

installAutosaveManagerAndBackupManager();
Expand All @@ -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) {
Expand Down Expand Up @@ -470,8 +467,8 @@ public void insertEntries(final List<BibEntry> 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));

Expand All @@ -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()));
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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()));
}
}
}
Expand Down Expand Up @@ -944,6 +941,7 @@ public IndexingTaskManager getIndexingTaskManager() {
}

public static class DatabaseNotification extends NotificationPane {

public DatabaseNotification(Node content) {
super(content);
}
Expand Down

0 comments on commit 750a5c0

Please sign in to comment.