diff --git a/CHANGELOG.md b/CHANGELOG.md index 38e1c8b26c9..f1126b31a18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,6 +113,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue where web search preferences "Custom API key" table modifications not discarded. [#11925](https://github.com/JabRef/jabref/issues/11925) - We fixed an issue when opening attached files in [extra file columns](https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#adding-additional-columns-to-entry-table-for-file-types). [#12005](https://github.com/JabRef/jabref/issues/12005) - We fixed an issue where trying to open a library from a failed mounted directory on Mac would cause an error. [#10548](https://github.com/JabRef/jabref/issues/10548) +- We fixed an issue when the preview was out of sync. [#9172](https://github.com/JabRef/jabref/issues/9172) - We fixed an issue where identifier paste couldn't work with Unicode REPLACEMENT CHARACTER. [#11986](https://github.com/JabRef/jabref/issues/11986) ### Removed diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index f7579709894..208e91dacb2 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -589,9 +589,6 @@ public void showAndEdit(BibEntry entry) { entryEditor.requestFocus(); } - /** - * Removes the bottom component. - */ public void closeBottomPane() { mode = PanelMode.MAIN_TABLE; splitPane.getItems().remove(entryEditor); diff --git a/src/main/java/org/jabref/gui/collab/DatabaseChangesResolverDialog.java b/src/main/java/org/jabref/gui/collab/DatabaseChangesResolverDialog.java index 7c86ee9950b..3c0be42e6ed 100644 --- a/src/main/java/org/jabref/gui/collab/DatabaseChangesResolverDialog.java +++ b/src/main/java/org/jabref/gui/collab/DatabaseChangesResolverDialog.java @@ -99,7 +99,8 @@ public boolean areAllChangesDenied() { @FXML private void initialize() { - PreviewViewer previewViewer = new PreviewViewer(database, dialogService, preferences, themeManager, taskExecutor); + PreviewViewer previewViewer = new PreviewViewer(dialogService, preferences, themeManager, taskExecutor); + previewViewer.setDatabaseContext(database); DatabaseChangeDetailsViewFactory databaseChangeDetailsViewFactory = new DatabaseChangeDetailsViewFactory(database, dialogService, themeManager, preferences, entryTypesManager, previewViewer, taskExecutor); viewModel = new ExternalChangesResolverViewModel(changes, undoManager); diff --git a/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeDetailsView.java b/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeDetailsView.java index 8cdabe824ef..f62934e7732 100644 --- a/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeDetailsView.java @@ -40,7 +40,8 @@ public EntryChangeDetailsView(BibEntry oldEntry, onDisk.getStyleClass().add("lib-change-header"); // we need a copy here as we otherwise would set the same entry twice - PreviewViewer previewClone = new PreviewViewer(databaseContext, dialogService, preferences, themeManager, taskExecutor); + PreviewViewer previewClone = new PreviewViewer(dialogService, preferences, themeManager, taskExecutor); + previewClone.setDatabaseContext(databaseContext); // The scroll bar used is not part of ScrollPane, but the attached WebView. WebView previewCloneView = (WebView) previewClone.getContent(); diff --git a/src/main/java/org/jabref/gui/entryeditor/CommentsTab.java b/src/main/java/org/jabref/gui/entryeditor/CommentsTab.java index 1930d618d9c..c9053f0a4bf 100644 --- a/src/main/java/org/jabref/gui/entryeditor/CommentsTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/CommentsTab.java @@ -16,26 +16,22 @@ import javafx.scene.layout.Priority; import javafx.scene.layout.RowConstraints; -import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProviders; import org.jabref.gui.fieldeditors.FieldEditorFX; import org.jabref.gui.fieldeditors.FieldNameLabel; import org.jabref.gui.fieldeditors.MarkdownEditor; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.preferences.GuiPreferences; -import org.jabref.gui.theme.ThemeManager; +import org.jabref.gui.preview.PreviewPanel; import org.jabref.gui.undo.RedoAction; import org.jabref.gui.undo.UndoAction; -import org.jabref.gui.util.OptionalObjectProperty; import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.l10n.Localization; -import org.jabref.logic.util.TaskExecutor; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UserSpecificCommentField; -import org.jabref.model.search.query.SearchQuery; public class CommentsTab extends FieldsEditorTab { public static final String NAME = "Comments"; @@ -51,25 +47,17 @@ public CommentsTab(GuiPreferences preferences, UndoManager undoManager, UndoAction undoAction, RedoAction redoAction, - DialogService dialogService, - ThemeManager themeManager, - TaskExecutor taskExecutor, JournalAbbreviationRepository journalAbbreviationRepository, - OptionalObjectProperty searchQueryProperty) { - super( - false, + PreviewPanel previewPanel) { + super(false, databaseContext, suggestionProviders, undoManager, undoAction, redoAction, - dialogService, preferences, - themeManager, - taskExecutor, journalAbbreviationRepository, - searchQueryProperty - ); + previewPanel); this.defaultOwner = preferences.getOwnerPreferences().getDefaultOwner().toLowerCase(Locale.ROOT).replaceAll("[^a-z0-9]", "-"); setText(Localization.lang("Comments")); setGraphic(IconTheme.JabRefIcons.COMMENT.getGraphicNode()); diff --git a/src/main/java/org/jabref/gui/entryeditor/DeprecatedFieldsTab.java b/src/main/java/org/jabref/gui/entryeditor/DeprecatedFieldsTab.java index c4f75a09893..6bef4bf0dd8 100644 --- a/src/main/java/org/jabref/gui/entryeditor/DeprecatedFieldsTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/DeprecatedFieldsTab.java @@ -9,24 +9,20 @@ import javafx.scene.control.Tooltip; -import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProviders; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.preferences.GuiPreferences; -import org.jabref.gui.theme.ThemeManager; +import org.jabref.gui.preview.PreviewPanel; import org.jabref.gui.undo.RedoAction; import org.jabref.gui.undo.UndoAction; -import org.jabref.gui.util.OptionalObjectProperty; import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.l10n.Localization; -import org.jabref.logic.util.TaskExecutor; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.entry.field.Field; -import org.jabref.model.search.query.SearchQuery; import com.tobiasdiez.easybind.EasyBind; @@ -40,14 +36,21 @@ public DeprecatedFieldsTab(BibDatabaseContext databaseContext, UndoManager undoManager, UndoAction undoAction, RedoAction redoAction, - DialogService dialogService, GuiPreferences preferences, - ThemeManager themeManager, BibEntryTypesManager entryTypesManager, - TaskExecutor taskExecutor, JournalAbbreviationRepository journalAbbreviationRepository, - OptionalObjectProperty searchQueryProperty) { - super(false, databaseContext, suggestionProviders, undoManager, undoAction, redoAction, dialogService, preferences, themeManager, taskExecutor, journalAbbreviationRepository, searchQueryProperty); + PreviewPanel previewPanel) { + super( + false, + databaseContext, + suggestionProviders, + undoManager, + undoAction, + redoAction, + preferences, + journalAbbreviationRepository, + previewPanel + ); this.entryTypesManager = entryTypesManager; setText(Localization.lang("Deprecated fields")); diff --git a/src/main/java/org/jabref/gui/entryeditor/DetailOptionalFieldsTab.java b/src/main/java/org/jabref/gui/entryeditor/DetailOptionalFieldsTab.java index a10d6aff476..48fb2ef017f 100644 --- a/src/main/java/org/jabref/gui/entryeditor/DetailOptionalFieldsTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/DetailOptionalFieldsTab.java @@ -2,19 +2,15 @@ import javax.swing.undo.UndoManager; -import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProviders; import org.jabref.gui.preferences.GuiPreferences; -import org.jabref.gui.theme.ThemeManager; +import org.jabref.gui.preview.PreviewPanel; import org.jabref.gui.undo.RedoAction; import org.jabref.gui.undo.UndoAction; -import org.jabref.gui.util.OptionalObjectProperty; import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.l10n.Localization; -import org.jabref.logic.util.TaskExecutor; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntryTypesManager; -import org.jabref.model.search.query.SearchQuery; public class DetailOptionalFieldsTab extends OptionalFieldsTabBase { @@ -25,13 +21,10 @@ public DetailOptionalFieldsTab(BibDatabaseContext databaseContext, UndoManager undoManager, UndoAction undoAction, RedoAction redoAction, - DialogService dialogService, GuiPreferences preferences, - ThemeManager themeManager, BibEntryTypesManager entryTypesManager, - TaskExecutor taskExecutor, JournalAbbreviationRepository journalAbbreviationRepository, - OptionalObjectProperty searchQueryProperty) { + PreviewPanel previewPanel) { super( Localization.lang("Optional fields 2"), false, @@ -40,13 +33,10 @@ public DetailOptionalFieldsTab(BibDatabaseContext databaseContext, undoManager, undoAction, redoAction, - dialogService, preferences, - themeManager, entryTypesManager, - taskExecutor, journalAbbreviationRepository, - searchQueryProperty + previewPanel ); } } diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java index b42152dd9a4..3a2bd6f2258 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java @@ -2,7 +2,6 @@ import java.io.File; import java.nio.file.Path; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; @@ -43,6 +42,7 @@ import org.jabref.gui.menus.ChangeEntryTypeMenu; import org.jabref.gui.mergeentries.FetchAndMergeEntry; import org.jabref.gui.preferences.GuiPreferences; +import org.jabref.gui.preview.PreviewPanel; import org.jabref.gui.theme.ThemeManager; import org.jabref.gui.undo.CountingUndoManager; import org.jabref.gui.undo.RedoAction; @@ -69,6 +69,7 @@ import com.tobiasdiez.easybind.EasyBind; import com.tobiasdiez.easybind.Subscription; import jakarta.inject.Inject; +import org.jspecify.annotations.NonNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -91,6 +92,7 @@ public class EntryEditor extends BorderPane { private final BibDatabaseContext databaseContext; private final EntryEditorPreferences entryEditorPreferences; private final ExternalFilesEntryLinker fileLinker; + private final PreviewPanel previewPanel; private final DirectoryMonitorManager directoryMonitorManager; private final UndoAction undoAction; private final RedoAction redoAction; @@ -121,7 +123,6 @@ public class EntryEditor extends BorderPane { @Inject private AiService aiService; private final List allPossibleTabs; - private final Collection previewTabs; public EntryEditor(LibraryTab libraryTab, UndoAction undoAction, RedoAction redoAction) { this.libraryTab = libraryTab; @@ -135,14 +136,22 @@ public EntryEditor(LibraryTab libraryTab, UndoAction undoAction, RedoAction redo .load(); this.entryEditorPreferences = preferences.getEntryEditorPreferences(); - this.fileLinker = new ExternalFilesEntryLinker(preferences.getExternalApplicationsPreferences(), preferences.getFilePreferences(), databaseContext, dialogService); + this.fileLinker = new ExternalFilesEntryLinker(preferences.getExternalApplicationsPreferences(), preferences.getFilePreferences(), dialogService, stateManager); + this.previewPanel = new PreviewPanel( + dialogService, + preferences.getKeyBindingRepository(), + preferences, + themeManager, + taskExecutor, + stateManager, + libraryTab.searchQueryProperty()); + this.previewPanel.setDatabase(databaseContext); setupKeyBindings(); this.allPossibleTabs = createTabs(); - this.previewTabs = this.allPossibleTabs.stream().filter(OffersPreview.class::isInstance).map(OffersPreview.class::cast).toList(); - setupDragAndDrop(libraryTab); + setupDragAndDrop(); EasyBind.subscribe(tabbed.getSelectionModel().selectedItemProperty(), tab -> { EntryEditorTab activeTab = (EntryEditorTab) tab; @@ -155,11 +164,18 @@ public EntryEditor(LibraryTab libraryTab, UndoAction undoAction, RedoAction redo (obs, oldValue, newValue) -> { if (currentlyEditedEntry != null) { adaptVisibleTabs(); + Tab tab = tabbed.getSelectionModel().selectedItemProperty().get(); + if (newValue && tab instanceof FieldsEditorTab fieldsEditorTab) { + fieldsEditorTab.removePreviewPanelFromThisTab(); + } + if (tab instanceof TabWithPreviewPanel previewTab) { + previewTab.handleFocus(); + } } }); } - private void setupDragAndDrop(LibraryTab libraryTab) { + private void setupDragAndDrop() { this.setOnDragOver(event -> { if (event.getDragboard().hasFiles()) { event.acceptTransferModes(TransferMode.COPY, TransferMode.MOVE, TransferMode.LINK); @@ -267,21 +283,21 @@ private void navigateToNextEntry() { private List createTabs() { List tabs = new LinkedList<>(); - tabs.add(new PreviewTab(databaseContext, dialogService, preferences, themeManager, taskExecutor, libraryTab.searchQueryProperty())); + tabs.add(new PreviewTab(databaseContext, preferences, previewPanel)); // Required, optional (important+detail), deprecated, and "other" fields - tabs.add(new RequiredFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, dialogService, preferences, themeManager, bibEntryTypesManager, taskExecutor, journalAbbreviationRepository, libraryTab.searchQueryProperty())); - tabs.add(new ImportantOptionalFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, dialogService, preferences, themeManager, bibEntryTypesManager, taskExecutor, journalAbbreviationRepository, libraryTab.searchQueryProperty())); - tabs.add(new DetailOptionalFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, dialogService, preferences, themeManager, bibEntryTypesManager, taskExecutor, journalAbbreviationRepository, libraryTab.searchQueryProperty())); - tabs.add(new DeprecatedFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, dialogService, preferences, themeManager, bibEntryTypesManager, taskExecutor, journalAbbreviationRepository, libraryTab.searchQueryProperty())); - tabs.add(new OtherFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, dialogService, preferences, themeManager, bibEntryTypesManager, taskExecutor, journalAbbreviationRepository, libraryTab.searchQueryProperty())); + tabs.add(new RequiredFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, preferences, bibEntryTypesManager, journalAbbreviationRepository, previewPanel)); + tabs.add(new ImportantOptionalFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, preferences, bibEntryTypesManager, journalAbbreviationRepository, previewPanel)); + tabs.add(new DetailOptionalFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, preferences, bibEntryTypesManager, journalAbbreviationRepository, previewPanel)); + tabs.add(new DeprecatedFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, preferences, bibEntryTypesManager, journalAbbreviationRepository, previewPanel)); + tabs.add(new OtherFieldsTab(databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, preferences, bibEntryTypesManager, journalAbbreviationRepository, previewPanel)); // Comment Tab: Tab for general and user-specific comments - tabs.add(new CommentsTab(preferences, databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, dialogService, themeManager, taskExecutor, journalAbbreviationRepository, libraryTab.searchQueryProperty())); + tabs.add(new CommentsTab(preferences, databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, journalAbbreviationRepository, previewPanel)); Map> entryEditorTabList = getAdditionalUserConfiguredTabs(); for (Map.Entry> tab : entryEditorTabList.entrySet()) { - tabs.add(new UserDefinedFieldsTab(tab.getKey(), tab.getValue(), databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, dialogService, preferences, themeManager, taskExecutor, journalAbbreviationRepository, libraryTab.searchQueryProperty())); + tabs.add(new UserDefinedFieldsTab(tab.getKey(), tab.getValue(), databaseContext, libraryTab.getSuggestionProviders(), undoManager, undoAction, redoAction, preferences, journalAbbreviationRepository, previewPanel)); } tabs.add(new MathSciNetTab()); @@ -374,8 +390,12 @@ public BibEntry getCurrentlyEditedEntry() { return currentlyEditedEntry; } - public void setCurrentlyEditedEntry(BibEntry currentlyEditedEntry) { - this.currentlyEditedEntry = Objects.requireNonNull(currentlyEditedEntry); + public void setCurrentlyEditedEntry(@NonNull BibEntry currentlyEditedEntry) { + if (Objects.equals(this.currentlyEditedEntry, currentlyEditedEntry)) { + return; + } + + this.currentlyEditedEntry = currentlyEditedEntry; // Subscribe to type changes for rebuilding the currently visible tab if (typeSubscription != null) { @@ -385,16 +405,13 @@ public void setCurrentlyEditedEntry(BibEntry currentlyEditedEntry) { typeSubscription = EasyBind.subscribe(this.currentlyEditedEntry.typeProperty(), type -> { typeLabel.setText(new TypedBibEntry(currentlyEditedEntry, databaseContext.getMode()).getTypeForDisplay()); adaptVisibleTabs(); + setupToolBar(); getSelectedTab().notifyAboutFocus(currentlyEditedEntry); }); - adaptVisibleTabs(); - setupToolBar(); - if (entryEditorPreferences.showSourceTabByDefault()) { tabbed.getSelectionModel().select(sourceTab); } - getSelectedTab().notifyAboutFocus(currentlyEditedEntry); } private EntryEditorTab getSelectedTab() { @@ -457,10 +474,10 @@ public void setFocusToField(Field field) { } public void nextPreviewStyle() { - this.previewTabs.forEach(OffersPreview::nextPreviewStyle); + this.previewPanel.nextPreviewStyle(); } public void previousPreviewStyle() { - this.previewTabs.forEach(OffersPreview::previousPreviewStyle); + this.previewPanel.previousPreviewStyle(); } } diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditorTab.java b/src/main/java/org/jabref/gui/entryeditor/EntryEditorTab.java index 1ac5ec4149b..61a89bd055b 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditorTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditorTab.java @@ -5,8 +5,13 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.types.EntryType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public abstract class EntryEditorTab extends Tab { + private static final Logger LOGGER = LoggerFactory.getLogger(EntryEditorTab.class); + protected BibEntry currentEntry; /** @@ -37,6 +42,10 @@ protected void handleFocus() { */ public void notifyAboutFocus(BibEntry entry) { if (!entry.equals(currentEntry) || !entry.getType().equals(currentEntryType)) { + // TODO: Shouldn't "bindToEntry" called when changing the entry? + LOGGER.trace("Tab got focus with different entry (or entry type) {}", entry); + LOGGER.trace("Different entry: {}", entry.equals(currentEntry)); + LOGGER.trace("Different entry type: {}", !entry.getType().equals(currentEntryType)); currentEntry = entry; currentEntryType = entry.getType(); bindToEntry(entry); diff --git a/src/main/java/org/jabref/gui/entryeditor/FieldsEditorTab.java b/src/main/java/org/jabref/gui/entryeditor/FieldsEditorTab.java index 4814dbb2776..eec4567e718 100644 --- a/src/main/java/org/jabref/gui/entryeditor/FieldsEditorTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/FieldsEditorTab.java @@ -24,47 +24,43 @@ import javafx.scene.layout.Region; import javafx.scene.layout.RowConstraints; -import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProviders; import org.jabref.gui.fieldeditors.FieldEditorFX; import org.jabref.gui.fieldeditors.FieldEditors; import org.jabref.gui.fieldeditors.FieldNameLabel; import org.jabref.gui.preferences.GuiPreferences; import org.jabref.gui.preview.PreviewPanel; -import org.jabref.gui.theme.ThemeManager; import org.jabref.gui.undo.RedoAction; import org.jabref.gui.undo.UndoAction; -import org.jabref.gui.util.OptionalObjectProperty; import org.jabref.logic.journals.JournalAbbreviationRepository; -import org.jabref.logic.util.TaskExecutor; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; -import org.jabref.model.search.query.SearchQuery; import com.tobiasdiez.easybind.EasyBind; import com.tobiasdiez.easybind.Subscription; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A single tab displayed in the EntryEditor holding several FieldEditors. */ -abstract class FieldsEditorTab extends EntryEditorTab implements OffersPreview { - protected final BibDatabaseContext databaseContext; +abstract class FieldsEditorTab extends TabWithPreviewPanel { + + private static final Logger LOGGER = LoggerFactory.getLogger(FieldsEditorTab.class); + protected final Map editors = new LinkedHashMap<>(); protected GridPane gridPane; private final boolean isCompressed; private final SuggestionProviders suggestionProviders; private final UndoAction undoAction; private final RedoAction redoAction; - private final DialogService dialogService; private final GuiPreferences preferences; - private final ThemeManager themeManager; - private final TaskExecutor taskExecutor; private final JournalAbbreviationRepository journalAbbreviationRepository; - private PreviewPanel previewPanel; private final UndoManager undoManager; - private final OptionalObjectProperty searchQueryProperty; + private Collection fields = new ArrayList<>(); + @SuppressWarnings("FieldCanBeLocal") private Subscription dividerPositionSubscription; @@ -74,24 +70,17 @@ public FieldsEditorTab(boolean compressed, UndoManager undoManager, UndoAction undoAction, RedoAction redoAction, - DialogService dialogService, GuiPreferences preferences, - ThemeManager themeManager, - TaskExecutor taskExecutor, JournalAbbreviationRepository journalAbbreviationRepository, - OptionalObjectProperty searchQueryProperty) { + PreviewPanel previewPanel) { + super(databaseContext, previewPanel); this.isCompressed = compressed; - this.databaseContext = Objects.requireNonNull(databaseContext); this.suggestionProviders = Objects.requireNonNull(suggestionProviders); this.undoManager = Objects.requireNonNull(undoManager); this.undoAction = undoAction; this.redoAction = redoAction; - this.dialogService = Objects.requireNonNull(dialogService); this.preferences = Objects.requireNonNull(preferences); - this.themeManager = themeManager; - this.taskExecutor = Objects.requireNonNull(taskExecutor); this.journalAbbreviationRepository = Objects.requireNonNull(journalAbbreviationRepository); - this.searchQueryProperty = searchQueryProperty; } private static void addColumn(GridPane gridPane, int columnIndex, List