diff --git a/CHANGELOG.md b/CHANGELOG.md index ee0ac9df3f4..0ac47b90749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We added "Hanging Indent" as the default selected bibliography body format for CSL styles that specify it (e.g. APA). [melting-pot#894](https://github.com/JabRef/jabref-issue-melting-pot/issues/894) - We fixed an issue where bibliography entries generated from CSL styles had leading spaces. [#13074](https://github.com/JabRef/jabref/pull/13074) - We fixed an issue where the preview area in the "Select Style" dialog of the LibreOffice integration was too small to display full content. [#13051](https://github.com/JabRef/jabref/issues/13051) +- We fixed an issue where the tab showing the fulltext search results was not displayed. [#12865](https://github.com/JabRef/jabref/issues/12865) ### Removed diff --git a/jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java b/jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java index 1a861acbf18..dfc7969d2f1 100644 --- a/jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java +++ b/jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java @@ -336,7 +336,7 @@ private List createTabs() { stateManager); tabs.add(sourceTab); tabs.add(new LatexCitationsTab(preferences, dialogService, stateManager, directoryMonitor)); - tabs.add(new FulltextSearchResultsTab(stateManager, preferences, dialogService, taskExecutor)); + tabs.add(new FulltextSearchResultsTab(stateManager, preferences, dialogService, taskExecutor, this)); tabs.add(new AiSummaryTab(aiService, dialogService, stateManager, this, preferences)); tabs.add(new AiChatTab(aiService, dialogService, preferences, stateManager, this, taskExecutor)); diff --git a/jabgui/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FulltextSearchResultsTab.java b/jabgui/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FulltextSearchResultsTab.java index 7571f8327d6..1331c30bc6c 100644 --- a/jabgui/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FulltextSearchResultsTab.java +++ b/jabgui/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FulltextSearchResultsTab.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Map; +import javafx.application.Platform; import javafx.geometry.Insets; import javafx.geometry.Orientation; import javafx.scene.control.ContextMenu; @@ -21,6 +22,7 @@ import org.jabref.gui.actions.StandardActions; import org.jabref.gui.desktop.os.NativeDesktop; import org.jabref.gui.documentviewer.DocumentViewerView; +import org.jabref.gui.entryeditor.EntryEditor; import org.jabref.gui.entryeditor.EntryEditorTab; import org.jabref.gui.maintable.OpenExternalFileAction; import org.jabref.gui.maintable.OpenFolderAction; @@ -49,19 +51,23 @@ public class FulltextSearchResultsTab extends EntryEditorTab { private final DialogService dialogService; private final ActionFactory actionFactory; private final TaskExecutor taskExecutor; + private final EntryEditor entryEditor; private final TextFlow content; + private BibEntry entry; private DocumentViewerView documentViewerView; public FulltextSearchResultsTab(StateManager stateManager, GuiPreferences preferences, DialogService dialogService, - TaskExecutor taskExecutor) { + TaskExecutor taskExecutor, + EntryEditor entryEditor) { this.stateManager = stateManager; this.preferences = preferences; this.dialogService = dialogService; this.actionFactory = new ActionFactory(); this.taskExecutor = taskExecutor; + this.entryEditor = entryEditor; content = new TextFlow(); ScrollPane scrollPane = new ScrollPane(content); @@ -91,11 +97,11 @@ protected void bindToEntry(BibEntry entry) { } private void updateSearch() { - content.getChildren().clear(); stateManager.activeSearchQuery(SearchType.NORMAL_SEARCH).get().ifPresent(searchQuery -> { SearchResults searchResults = searchQuery.getSearchResults(); if (searchResults != null && entry != null) { Map> searchResultsForEntry = searchResults.getFileSearchResultsForEntry(entry); + content.getChildren().clear(); if (searchResultsForEntry.isEmpty()) { content.getChildren().add(new Text(Localization.lang("No search matches."))); } else { @@ -125,6 +131,7 @@ private void updateSearch() { } } }); + Platform.runLater(entryEditor::adaptVisibleTabs); } private Text createFileLink(LinkedFile linkedFile) {