public class SearchHandler extends Object
Type | Property and Description |
---|---|
javafx.beans.property.ReadOnlyObjectProperty<Category> |
categoryMatch
Represents the category which is matched by the search and should ultimately be displayed.
|
Constructor and Description |
---|
SearchHandler() |
Modifier and Type | Method and Description |
---|---|
void |
bindFilterPredicate(javafx.beans.property.ObjectProperty<org.eclipse.fx.ui.controls.tree.TreeItemPredicate<Category>> predicateProperty)
Binds the predicateProperty to ensure filtering according to the searchText.
|
javafx.beans.property.ReadOnlyObjectProperty<Category> |
categoryMatchProperty()
Represents the category which is matched by the search and should ultimately be displayed.
|
Category |
compareMatches(Category setting,
Category group,
Category category,
int settingMatch,
int groupMatch,
int categoryMatch)
Compares three categories with decreasing priority from the first to the last category.
|
Category |
getCategoryMatch()
Gets the value of the property categoryMatch.
|
void |
init(PreferencesFxModel model,
javafx.beans.property.StringProperty searchText,
javafx.beans.property.ObjectProperty<org.eclipse.fx.ui.controls.tree.TreeItemPredicate<Category>> predicateProperty)
Initializes the SearchHandler by initially creating all necessary lists
for filtering and setting up the bindings.
|
void |
initializeSearchText(javafx.beans.property.StringProperty searchText)
Initializes the search text by binding it and then adding a listener to react to changes.
|
void |
updateSearch(String searchText)
Updates the search based on a new
searchText . |
public javafx.beans.property.ReadOnlyObjectProperty<Category> categoryMatchProperty
getCategoryMatch()
public void init(PreferencesFxModel model, javafx.beans.property.StringProperty searchText, javafx.beans.property.ObjectProperty<org.eclipse.fx.ui.controls.tree.TreeItemPredicate<Category>> predicateProperty)
searchText
- textProperty of a TextField where the search string is being inputpredicateProperty
- of the rootItem of a FilterableTreeItem
public void initializeSearchText(javafx.beans.property.StringProperty searchText)
public void bindFilterPredicate(javafx.beans.property.ObjectProperty<org.eclipse.fx.ui.controls.tree.TreeItemPredicate<Category>> predicateProperty)
predicateProperty
- of the rootItem of a FilterableTreeItem
public void updateSearch(String searchText)
searchText
.searchText
- the new text to be searched forpublic Category compareMatches(Category setting, Category group, Category category, int settingMatch, int groupMatch, int categoryMatch)
reference
for further informationsetting
- category to return, if settingsMatch is chosengroup
- category to return, if groupMatch is chosencategory
- category to return, if categoryMatch is chosensettingMatch
- amount of settings which matchgroupMatch
- amount of groups which matchcategoryMatch
- amount of categories which matchpublic Category getCategoryMatch()
public javafx.beans.property.ReadOnlyObjectProperty<Category> categoryMatchProperty()
getCategoryMatch()
Copyright © 2019. All rights reserved.