Verified Owner
Top Description Fields Constructors Methods
org.jabref.gui.preferences

pack-priv Class PreferencesSearchHandler

extends Object
Class Inheritance
Imports
java.util.List, .Locale, .Map, java.util.function.Function, java.util.stream.Collectors, javafx.beans.property.ListProperty, .SimpleListProperty, javafx.collections.FXCollections, javafx.css.PseudoClass

Filters the preference tabs by a search query and highlights the matching elements.

Tabs declare what is searchable themselves: the visible texts (with the node they caption) come from PreferencesTab#getSearchableElements(), extra invisible synonyms from PreferencesTab#getSearchKeywords(). There is no scene-graph scanning.

Field Summary

Modifier and TypeField and Description
private final ListProperty<PreferencesTab>
private final List<PreferencesTab>
private static final PseudoClass
private final Map<PreferencesTab, List<SearchableElement>>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
protected ListProperty<PreferencesTab>
public void
private boolean
tabMatchesQuery(PreferencesTab tab, String query)

Returns: true if the query occurs in the tab's keywords or visible texts; matching visible elements are highlighted as a side effect.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filteredPreferenceTabsback to summary
private final ListProperty<PreferencesTab> filteredPreferenceTabs
preferenceTabsback to summary
private final List<PreferencesTab> preferenceTabs
SEARCH_HIGHLIGHTback to summary
private static final PseudoClass SEARCH_HIGHLIGHT
searchableElementsback to summary
private final Map<PreferencesTab, List<SearchableElement>> searchableElements

Constructor Detail

PreferencesSearchHandlerback to summary
pack-priv PreferencesSearchHandler(List<PreferencesTab> preferenceTabs)

Method Detail

clearHighlightsback to summary
private void clearHighlights()
filteredPreferenceTabsPropertyback to summary
protected ListProperty<PreferencesTab> filteredPreferenceTabsProperty()
filterTabsback to summary
public void filterTabs(String query)
tabMatchesQueryback to summary
private boolean tabMatchesQuery(PreferencesTab tab, String query)
Returns:boolean

true if the query occurs in the tab's keywords or visible texts; matching visible elements are highlighted as a side effect.