Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search floating mode #11510

Merged
merged 65 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
33fde54
Search/Groups floating mode
LoayGhreeb Jul 16, 2024
8d54d0d
Hide search rank column
LoayGhreeb Jul 16, 2024
b441fe5
Update query listener from global to library-specific
LoayGhreeb Jul 17, 2024
0485cd5
Update selected groups listener from global to library-specific
LoayGhreeb Jul 17, 2024
94c8de1
Move table-row CSS classes to Base.css
LoayGhreeb Jul 17, 2024
e3c1c0b
Adapt tests
LoayGhreeb Jul 17, 2024
212df75
Update JabRef_en.properties
LoayGhreeb Jul 17, 2024
37fc247
CHANGELOG
LoayGhreeb Jul 17, 2024
21c834a
Fix jumpToSearchKey
LoayGhreeb Jul 17, 2024
3e2b65f
Add shortcut to scroll to the next/prev rank
LoayGhreeb Jul 17, 2024
26af9f0
Localization
LoayGhreeb Jul 17, 2024
da05a82
Fix scroll shortcut to handle rank gaps
LoayGhreeb Jul 19, 2024
9867c97
OpenRewrite
LoayGhreeb Jul 19, 2024
598b624
Add temporary MappedBackedList implementation
LoayGhreeb Jul 22, 2024
4abcfc7
Use constants for rank values
LoayGhreeb Jul 22, 2024
564de70
Update rank colors
LoayGhreeb Jul 22, 2024
f1b5f55
Merge branch 'main' into floating-mode
LoayGhreeb Jul 22, 2024
93dcd92
Add CustomFilteredList
LoayGhreeb Jul 24, 2024
b66b4a9
Improve group switching and search performance
LoayGhreeb Jul 24, 2024
1582fb0
OpenRewrite
LoayGhreeb Jul 24, 2024
a4cba3e
Fix NPE
LoayGhreeb Jul 24, 2024
1ff7afb
Fix NPE
LoayGhreeb Jul 24, 2024
0c2a23b
Create a list of observables
LoayGhreeb Jul 24, 2024
bde0b64
refilter the list after updateVisibility
LoayGhreeb Jul 24, 2024
3a7611b
Add onUpdateCallback to the CustomFilteredList
LoayGhreeb Jul 24, 2024
800fc02
Merge branch 'main' into floating-mode
LoayGhreeb Jul 24, 2024
2efc74d
iterate over updated range
LoayGhreeb Jul 26, 2024
8fd600d
Merge branch 'main' into floating-mode
LoayGhreeb Jul 26, 2024
32f16ed
Merge branch 'main' into floating-mode
LoayGhreeb Jul 26, 2024
ab7e19f
Rename onUpdateCallback to onUpdate
LoayGhreeb Jul 26, 2024
9c5ba79
Merge branch 'main' into floating-mode
LoayGhreeb Jul 28, 2024
be04ce9
Register events to the row
LoayGhreeb Jul 29, 2024
cfe930a
Update matches in the background
LoayGhreeb Jul 29, 2024
7e5b106
Merge branch 'main' into floating-mode
LoayGhreeb Jul 29, 2024
b87be0b
Merge branch 'main' into floating-mode
LoayGhreeb Jul 29, 2024
b846805
Delete MappedBackedList.java
LoayGhreeb Jul 29, 2024
2330ed6
Update matches in the background for global search
LoayGhreeb Jul 29, 2024
c1d7e27
Pass properties to MainTableDataModel instead of LibraryTab
LoayGhreeb Jul 31, 2024
4608d0c
Remove search rank column from the preferences
LoayGhreeb Aug 1, 2024
e0f8b08
Merge branch 'main' into floating-mode
LoayGhreeb Aug 1, 2024
f15acdb
Add SearchRank enum
LoayGhreeb Aug 2, 2024
296622b
EnumSet constructor
LoayGhreeb Aug 2, 2024
108a39e
Remove int value from SearchRank enum
LoayGhreeb Aug 2, 2024
28614df
Merge branch 'main' into floating-mode
LoayGhreeb Aug 2, 2024
5c45007
Move SearchRank enum to search package
LoayGhreeb Aug 4, 2024
c62809f
Remove FILTERING_SEARCH from search flags
LoayGhreeb Aug 4, 2024
9f6c846
Merge branch 'main' into floating-mode
LoayGhreeb Aug 4, 2024
69e035b
Remove KEEP_SEARCH_STRING from search flags
LoayGhreeb Aug 4, 2024
1313928
Fix SearchPreferences constructor
calixtus Aug 4, 2024
738d03c
Move comment up
calixtus Aug 4, 2024
ce71705
Rename SearchRank to MatchCategory
LoayGhreeb Aug 4, 2024
5eff567
Update src/main/java/org/jabref/gui/util/CustomFilteredList.java
LoayGhreeb Aug 4, 2024
46c2484
Update src/main/java/org/jabref/gui/util/CustomFilteredList.java
LoayGhreeb Aug 4, 2024
656e8fd
Update CustomFilteredList.java
LoayGhreeb Aug 4, 2024
e2c3a7a
Update PreferencesMigrations.java
LoayGhreeb Aug 4, 2024
e3c492e
Replace CustomFilteredList.java with reflection
calixtus Aug 4, 2024
be88666
Merge remote-tracking branch 'upstream/floating-mode' into floating-mode
calixtus Aug 4, 2024
e340a15
Merge branch 'main' into floating-mode
calixtus Aug 4, 2024
fab86b7
Minor stylistic fixes
koppor Aug 4, 2024
240d0fc
Fix reflection
calixtus Aug 4, 2024
d1b5450
Merge remote-tracking branch 'upstream/floating-mode' into floating-mode
calixtus Aug 4, 2024
c6cbeb5
Correct typo
LoayGhreeb Aug 4, 2024
50ae791
Fix typo
koppor Aug 4, 2024
b289c91
Fix unit tests
LoayGhreeb Aug 4, 2024
3ca41b4
CHANGELOG
LoayGhreeb Aug 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/deployment-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ jobs:
--java-options --add-opens=javafx.graphics/javafx.scene=org.jabref \
--java-options --add-opens=javafx.controls/javafx.scene.control=org.jabref \
--java-options --add-opens=javafx.controls/com.sun.javafx.scene.control=org.jabref \
--java-options --add-opens=javafx.base/javafx.collections=org.jabref \
--java-options --add-opens=javafx.base/javafx.collections.transformation=org.jabref \
--java-options --add-modules=jdk.incubator.vector
- name: Build pkg (macOS)
if: (steps.checksecrets.outputs.secretspresent == 'YES')
Expand Down Expand Up @@ -179,6 +181,8 @@ jobs:
--java-options --add-opens=javafx.graphics/javafx.scene=org.jabref \
--java-options --add-opens=javafx.controls/javafx.scene.control=org.jabref \
--java-options --add-opens=javafx.controls/com.sun.javafx.scene.control=org.jabref \
--java-options --add-opens=javafx.base/javafx.collections=org.jabref \
--java-options --add-opens=javafx.base/javafx.collections.transformation=org.jabref \
--java-options --add-modules=jdk.incubator.vector
- name: Rename files with arm64 suffix as well
if: (steps.checksecrets.outputs.secretspresent == 'YES')
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ jobs:
--java-options --add-opens=javafx.graphics/javafx.scene=org.jabref \
--java-options --add-opens=javafx.controls/javafx.scene.control=org.jabref \
--java-options --add-opens=javafx.controls/com.sun.javafx.scene.control=org.jabref \
--java-options --add-opens=javafx.base/javafx.collections=org.jabref \
--java-options --add-opens=javafx.base/javafx.collections.transformation=org.jabref \
--java-options --add-modules=jdk.incubator.vector
- name: Build pkg (macOS)
if: (matrix.os == 'macos-13') && (steps.checksecrets.outputs.secretspresent == 'YES')
Expand Down Expand Up @@ -192,6 +194,8 @@ jobs:
--java-options --add-opens=javafx.graphics/javafx.scene=org.jabref \
--java-options --add-opens=javafx.controls/javafx.scene.control=org.jabref \
--java-options --add-opens=javafx.controls/com.sun.javafx.scene.control=org.jabref \
--java-options --add-opens=javafx.base/javafx.collections=org.jabref \
--java-options --add-opens=javafx.base/javafx.collections.transformation=org.jabref \
--java-options --add-modules=jdk.incubator.vector
- name: Build runtime image and installer (linux, Windows)
if: (matrix.os != 'macos-13') && (steps.checksecrets.outputs.secretspresent == 'YES')
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- The dialog for [adding an entry using reference text](https://docs.jabref.org/collect/newentryfromplaintext) is now filled with the clipboard contents as default. [#11565](https://github.com/JabRef/jabref/pull/11565)
- Added minimal support for [biblatex data annotation](https://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf#subsection.3.7) fields in `.layout` files. [#11505](https://github.com/JabRef/jabref/issues/11505)
- Added saving of selected options in the [Lookup -> Search for unlinked local files dialog](https://docs.jabref.org/collect/findunlinkedfiles#link-the-pdfs-to-your-bib-library). [#11439](https://github.com/JabRef/jabref/issues/11439)
- We added a toggle button to invert the selected groups. [#9073](https://github.com/JabRef/jabref/issues/9073)
- We reintroduced the floating search in the main table. [#4237](https://github.com/JabRef/jabref/issues/4237)

### Changed

Expand Down
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ application {
'--add-exports=javafx.controls/com.sun.javafx.scene.control=org.jabref',
'--add-opens=javafx.graphics/javafx.scene=org.jabref',
'--add-opens=javafx.controls/javafx.scene.control=org.jabref',
'--add-opens=javafx.controls/com.sun.javafx.scene.control=org.jabref'
'--add-opens=javafx.controls/com.sun.javafx.scene.control=org.jabref',

'--add-opens=javafx.base/javafx.collections=org.jabref',
'--add-opens=javafx.base/javafx.collections.transformation=org.jabref'
]
}

Expand Down Expand Up @@ -495,7 +498,10 @@ run {
'org.controlsfx.controls/org.controlsfx.control.textfield' : 'org.jabref',

'javafx.controls/javafx.scene.control.skin' : 'org.controlsfx.controls',
'javafx.graphics/javafx.scene' : 'org.controlsfx.controls'
'javafx.graphics/javafx.scene' : 'org.controlsfx.controls',

'javafx.base/javafx.collections' : 'org.jabref',
'javafx.base/javafx.collections.transformation' : 'org.jabref'
]

addModules = [
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,22 @@ TextFlow > .tooltip-text-monospaced {
-fx-padding: 0 .5 0 .5;
}

.table-row-cell:matching-search-and-groups {
-fx-background-color: white;
}

.table-row-cell:matching-search-not-groups {
-fx-background-color: rgba(180, 180, 180, 0.86);
}

.table-row-cell:matching-groups-not-search {
-fx-background-color: rgba(140, 140, 140, 0.86);
}

.table-row-cell:not-matching-search-and-groups {
-fx-opacity: 60%;
}

.table-row-cell:hover,
.tree-table-row-cell:hover {
-fx-background-color: -jr-hover;
Expand Down
55 changes: 33 additions & 22 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
import javafx.animation.PauseTransition;
import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ListProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.beans.value.ObservableBooleanValue;
import javafx.collections.ListChangeListener;
import javafx.event.Event;
Expand Down Expand Up @@ -58,6 +62,7 @@
import org.jabref.gui.undo.UndoableInsertEntries;
import org.jabref.gui.undo.UndoableRemoveEntries;
import org.jabref.gui.util.BackgroundTask;
import org.jabref.gui.util.OptionalObjectProperty;
import org.jabref.gui.util.TaskExecutor;
import org.jabref.gui.util.UiTaskExecutor;
import org.jabref.logic.citationstyle.CitationStyleCache;
Expand Down Expand Up @@ -88,6 +93,7 @@
import org.jabref.model.entry.field.Field;
import org.jabref.model.entry.field.FieldFactory;
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.groups.GroupTreeNode;
import org.jabref.model.util.DirectoryMonitor;
import org.jabref.model.util.DirectoryMonitorManager;
import org.jabref.model.util.FileUpdateMonitor;
Expand Down Expand Up @@ -149,8 +155,9 @@ private enum PanelMode { MAIN_TABLE, MAIN_TABLE_AND_ENTRY_EDITOR }
@SuppressWarnings({"FieldCanBeLocal"})
private Subscription dividerPositionSubscription;

// the query the user searches when this BasePanel is active
private Optional<SearchQuery> currentSearchQuery = Optional.empty();
private ListProperty<GroupTreeNode> selectedGroupsProperty;
private final OptionalObjectProperty<SearchQuery> searchQueryProperty = OptionalObjectProperty.empty();
private final IntegerProperty resultSize = new SimpleIntegerProperty(0);

private Optional<DatabaseChangeMonitor> changeMonitor = Optional.empty();

Expand All @@ -162,15 +169,15 @@ private enum PanelMode { MAIN_TABLE, MAIN_TABLE_AND_ENTRY_EDITOR }
private final DirectoryMonitorManager directoryMonitorManager;

private LibraryTab(BibDatabaseContext bibDatabaseContext,
LibraryTabContainer tabContainer,
DialogService dialogService,
PreferencesService preferencesService,
StateManager stateManager,
FileUpdateMonitor fileUpdateMonitor,
BibEntryTypesManager entryTypesManager,
CountingUndoManager undoManager,
ClipBoardManager clipBoardManager,
TaskExecutor taskExecutor) {
LibraryTabContainer tabContainer,
DialogService dialogService,
PreferencesService preferencesService,
StateManager stateManager,
FileUpdateMonitor fileUpdateMonitor,
BibEntryTypesManager entryTypesManager,
CountingUndoManager undoManager,
ClipBoardManager clipBoardManager,
TaskExecutor taskExecutor) {
this.tabContainer = Objects.requireNonNull(tabContainer);
this.bibDatabaseContext = Objects.requireNonNull(bibDatabaseContext);
this.undoManager = undoManager;
Expand All @@ -187,7 +194,8 @@ private LibraryTab(BibDatabaseContext bibDatabaseContext,
bibDatabaseContext.getDatabase().registerListener(this);
bibDatabaseContext.getMetaData().registerListener(this);

this.tableModel = new MainTableDataModel(getBibDatabaseContext(), preferencesService, stateManager);
this.selectedGroupsProperty = new SimpleListProperty<>(stateManager.getSelectedGroups(bibDatabaseContext));
this.tableModel = new MainTableDataModel(getBibDatabaseContext(), preferencesService, taskExecutor, selectedGroupsProperty(), searchQueryProperty(), resultSizeProperty());

citationStyleCache = new CitationStyleCache(bibDatabaseContext);
annotationCache = new FileAnnotationCache(bibDatabaseContext, preferencesService.getFilePreferences());
Expand Down Expand Up @@ -318,7 +326,10 @@ private void setDatabaseContext(BibDatabaseContext bibDatabaseContext) {
bibDatabaseContext.getDatabase().registerListener(this);
bibDatabaseContext.getMetaData().registerListener(this);

this.tableModel = new MainTableDataModel(getBibDatabaseContext(), preferencesService, stateManager);
this.tableModel.unbind();
this.selectedGroupsProperty = new SimpleListProperty<>(stateManager.getSelectedGroups(bibDatabaseContext));
this.tableModel = new MainTableDataModel(getBibDatabaseContext(), preferencesService, taskExecutor, selectedGroupsProperty(), searchQueryProperty(), resultSizeProperty());

citationStyleCache = new CitationStyleCache(bibDatabaseContext);
annotationCache = new FileAnnotationCache(bibDatabaseContext, preferencesService.getFilePreferences());

Expand Down Expand Up @@ -875,6 +886,9 @@ private void onClosed(Event event) {
LOGGER.error("Problem when shutting down backup manager", e);
}

if (tableModel != null) {
tableModel.unbind();
}
// clean up the groups map
stateManager.clearSelectedGroups(bibDatabaseContext);
}
Expand Down Expand Up @@ -916,19 +930,16 @@ public MainTable getMainTable() {
return mainTable;
}

public Optional<SearchQuery> getCurrentSearchQuery() {
return currentSearchQuery;
public ListProperty<GroupTreeNode> selectedGroupsProperty() {
return selectedGroupsProperty;
}

/**
* Set the query the user currently searches while this basepanel is active
*/
public void setCurrentSearchQuery(Optional<SearchQuery> currentSearchQuery) {
this.currentSearchQuery = currentSearchQuery;
public OptionalObjectProperty<SearchQuery> searchQueryProperty() {
return searchQueryProperty;
}

public CitationStyleCache getCitationStyleCache() {
return citationStyleCache;
public IntegerProperty resultSizeProperty() {
return resultSize;
}
calixtus marked this conversation as resolved.
Show resolved Hide resolved

public FileAnnotationCache getAnnotationCache() {
Expand Down
72 changes: 11 additions & 61 deletions src/main/java/org/jabref/gui/StateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
import java.util.Optional;

import javafx.beans.Observable;
import javafx.beans.binding.Bindings;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyListProperty;
import javafx.beans.property.ReadOnlyListWrapper;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
Expand All @@ -22,6 +19,7 @@
import javafx.util.Pair;

import org.jabref.gui.edit.automaticfiededitor.LastAutomaticFieldEditorEdit;
import org.jabref.gui.search.SearchType;
import org.jabref.gui.sidepane.SidePaneType;
import org.jabref.gui.util.BackgroundTask;
import org.jabref.gui.util.CustomLocalDragboard;
Expand Down Expand Up @@ -56,29 +54,22 @@ public class StateManager {
private final ObservableList<BibDatabaseContext> openDatabases = FXCollections.observableArrayList();
private final OptionalObjectProperty<BibDatabaseContext> activeDatabase = OptionalObjectProperty.empty();
private final OptionalObjectProperty<LibraryTab> activeTab = OptionalObjectProperty.empty();
private final ReadOnlyListWrapper<GroupTreeNode> activeGroups = new ReadOnlyListWrapper<>(FXCollections.observableArrayList());
private final ObservableList<BibEntry> selectedEntries = FXCollections.observableArrayList();
private final ObservableMap<String, ObservableList<GroupTreeNode>> selectedGroups = FXCollections.observableHashMap();
private final OptionalObjectProperty<SearchQuery> activeSearchQuery = OptionalObjectProperty.empty();
private final OptionalObjectProperty<SearchQuery> activeGlobalSearchQuery = OptionalObjectProperty.empty();
private final IntegerProperty searchResultSize = new SimpleIntegerProperty(0);
private final IntegerProperty globalSearchResultSize = new SimpleIntegerProperty(0);
private final ObservableMap<String, IntegerProperty> searchResultMap = FXCollections.observableHashMap();
private final OptionalObjectProperty<Node> focusOwner = OptionalObjectProperty.empty();
private final ObservableList<Pair<BackgroundTask<?>, Task<?>>> backgroundTasks = FXCollections.observableArrayList(task -> new Observable[] {task.getValue().progressProperty(), task.getValue().runningProperty()});
private final EasyBinding<Boolean> anyTaskRunning = EasyBind.reduce(backgroundTasks, tasks -> tasks.map(Pair::getValue).anyMatch(Task::isRunning));
private final EasyBinding<Boolean> anyTasksThatWillNotBeRecoveredRunning = EasyBind.reduce(backgroundTasks, tasks -> tasks.anyMatch(task -> !task.getKey().willBeRecoveredAutomatically() && task.getValue().isRunning()));
private final EasyBinding<Double> tasksProgress = EasyBind.reduce(backgroundTasks, tasks -> tasks.map(Pair::getValue).filter(Task::isRunning).mapToDouble(Task::getProgress).average().orElse(1));
private final ObservableMap<String, DialogWindowState> dialogWindowStates = FXCollections.observableHashMap();
private final ObservableList<SidePaneType> visibleSidePanes = FXCollections.observableArrayList();

private final ObjectProperty<LastAutomaticFieldEditorEdit> lastAutomaticFieldEditorEdit = new SimpleObjectProperty<>();

private final ObservableList<String> searchHistory = FXCollections.observableArrayList();

public StateManager() {
activeGroups.bind(Bindings.valueAt(selectedGroups, activeDatabase.orElseOpt(null).map(BibDatabaseContext::getUid)));
}

public ObservableList<SidePaneType> getVisibleSidePaneComponents() {
return visibleSidePanes;
}
Expand All @@ -99,36 +90,12 @@ public OptionalObjectProperty<LibraryTab> activeTabProperty() {
return activeTab;
}

public OptionalObjectProperty<SearchQuery> activeSearchQueryProperty() {
return activeSearchQuery;
}

public void setActiveSearchResultSize(BibDatabaseContext database, IntegerProperty resultSize) {
searchResultMap.put(database.getUid(), resultSize);
}

public IntegerProperty getSearchResultSize() {
return searchResultMap.getOrDefault(activeDatabase.getValue().orElse(new BibDatabaseContext()).getUid(), new SimpleIntegerProperty(0));
}

public OptionalObjectProperty<SearchQuery> activeGlobalSearchQueryProperty() {
return activeGlobalSearchQuery;
}

public IntegerProperty getGlobalSearchResultSize() {
return globalSearchResultSize;
public OptionalObjectProperty<SearchQuery> activeSearchQuery(SearchType type) {
return type == SearchType.NORMAL_SEARCH ? activeSearchQuery : activeGlobalSearchQuery;
}

public IntegerProperty getSearchResultSize(OptionalObjectProperty<SearchQuery> searchQueryProperty) {
if (searchQueryProperty.equals(activeSearchQuery)) {
return getSearchResultSize();
} else {
return getGlobalSearchResultSize();
}
}

public ReadOnlyListProperty<GroupTreeNode> activeGroupProperty() {
return activeGroups.getReadOnlyProperty();
public IntegerProperty searchResultSize(SearchType type) {
return type == SearchType.NORMAL_SEARCH ? searchResultSize : globalSearchResultSize;
}

public ObservableList<BibEntry> getSelectedEntries() {
Expand All @@ -139,18 +106,17 @@ public void setSelectedEntries(List<BibEntry> newSelectedEntries) {
selectedEntries.setAll(newSelectedEntries);
}

public void setSelectedGroups(BibDatabaseContext database, List<GroupTreeNode> newSelectedGroups) {
public void setSelectedGroups(BibDatabaseContext context, List<GroupTreeNode> newSelectedGroups) {
Objects.requireNonNull(newSelectedGroups);
selectedGroups.put(database.getUid(), FXCollections.observableArrayList(newSelectedGroups));
selectedGroups.computeIfAbsent(context.getUid(), k -> FXCollections.observableArrayList()).setAll(newSelectedGroups);
}

public ObservableList<GroupTreeNode> getSelectedGroups(BibDatabaseContext context) {
ObservableList<GroupTreeNode> selectedGroupsForDatabase = selectedGroups.get(context.getUid());
return selectedGroupsForDatabase != null ? selectedGroupsForDatabase : FXCollections.observableArrayList();
return selectedGroups.computeIfAbsent(context.getUid(), k -> FXCollections.observableArrayList());
}

public void clearSelectedGroups(BibDatabaseContext database) {
selectedGroups.remove(database.getUid());
public void clearSelectedGroups(BibDatabaseContext context) {
selectedGroups.computeIfAbsent(context.getUid(), k -> FXCollections.observableArrayList()).clear();
}

public Optional<BibDatabaseContext> getActiveDatabase() {
Expand All @@ -166,18 +132,6 @@ public void setActiveDatabase(BibDatabaseContext database) {
}
}

public void clearSearchQuery() {
activeSearchQuery.setValue(Optional.empty());
}

public void setSearchQuery(OptionalObjectProperty<SearchQuery> searchQueryProperty, SearchQuery query) {
searchQueryProperty.setValue(Optional.of(query));
}

public void clearSearchQuery(OptionalObjectProperty<SearchQuery> searchQueryProperty) {
searchQueryProperty.setValue(Optional.empty());
}

public OptionalObjectProperty<Node> focusOwnerProperty() {
return focusOwner;
}
Expand Down Expand Up @@ -219,10 +173,6 @@ public ObjectProperty<LastAutomaticFieldEditorEdit> lastAutomaticFieldEditorEdit
return lastAutomaticFieldEditorEdit;
}

public LastAutomaticFieldEditorEdit getLastAutomaticFieldEditorEdit() {
return lastAutomaticFieldEditorEditProperty().get();
}

public void setLastAutomaticFieldEditorEdit(LastAutomaticFieldEditorEdit automaticFieldEditorEdit) {
lastAutomaticFieldEditorEditProperty().set(automaticFieldEditorEdit);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,12 @@ private List<EntryEditorTab> createTabs() {
preferencesService.getImportFormatPreferences(),
fileMonitor,
dialogService,
stateManager,
bibEntryTypesManager,
keyBindingRepository);
keyBindingRepository,
libraryTab.searchQueryProperty());
tabs.add(sourceTab);
tabs.add(new LatexCitationsTab(databaseContext, preferencesService, dialogService, directoryMonitorManager));
tabs.add(new FulltextSearchResultsTab(stateManager, preferencesService, dialogService, taskExecutor));
tabs.add(new FulltextSearchResultsTab(stateManager, preferencesService, dialogService, taskExecutor, libraryTab.searchQueryProperty()));

return tabs;
}
Expand Down
Loading
Loading