T - The type of the value property within TreeItem.public class FilterableTreeItem<T>
extends javafx.scene.control.CheckBoxTreeItem<T>
TreeItem with the possibility to filter its children. To enable filtering
it is necessary to set the TreeItemPredicate. If a predicate is set, then the tree item
will also use this predicate to filter its children (if they are of the type FilterableTreeItem).
A tree item that has children will not be filtered. The predicate will only be evaluated, if the
tree item is a leaf. Since the predicate is also set for the child tree items, the tree item in question
can turn into a leaf if all its children are filtered.
This class extends CheckBoxTreeItem so it can, but does not need to be, used in conjunction
with CheckBoxTreeCell cells.| Constructor and Description |
|---|
FilterableTreeItem(T value)
Creates a new
TreeItem with sorted children. |
| Modifier and Type | Method and Description |
|---|---|
javafx.collections.ObservableList<javafx.scene.control.TreeItem<T>> |
getInternalChildren()
Returns the list of children that is backing the filtered list.
|
TreeItemPredicate<T> |
getPredicate() |
javafx.beans.property.ObjectProperty<TreeItemPredicate<T>> |
predicateProperty() |
protected void |
setHiddenFieldChildren(javafx.collections.ObservableList<javafx.scene.control.TreeItem<T>> list)
Set the hidden private field
TreeItem.children through reflection and hook the hidden
ListChangeListener in TreeItem.childrenListener to the list |
void |
setPredicate(TreeItemPredicate<T> predicate)
Set the predicate
|
checkBoxSelectionChangedEvent, independentProperty, indeterminateProperty, isIndependent, isIndeterminate, isSelected, selectedProperty, setIndependent, setIndeterminate, setSelectedaddEventHandler, branchCollapsedEvent, branchExpandedEvent, buildEventDispatchChain, childrenModificationEvent, expandedItemCountChangeEvent, expandedProperty, getChildren, getGraphic, getParent, getValue, graphicChangedEvent, graphicProperty, isExpanded, isLeaf, leafProperty, nextSibling, nextSibling, parentProperty, previousSibling, previousSibling, removeEventHandler, setExpanded, setGraphic, setValue, toString, treeNotificationEvent, valueChangedEvent, valuePropertypublic FilterableTreeItem(T value)
TreeItem with sorted children. To enable sorting it is
necessary to set the TreeItemComparator. If no comparator is set, then
the tree item will attempt so bind itself to the comparator of its parent.value - the value of the TreeItemprotected void setHiddenFieldChildren(javafx.collections.ObservableList<javafx.scene.control.TreeItem<T>> list)
TreeItem.children through reflection and hook the hidden
ListChangeListener in TreeItem.childrenListener to the listlist - the list to setpublic javafx.collections.ObservableList<javafx.scene.control.TreeItem<T>> getInternalChildren()
public final javafx.beans.property.ObjectProperty<TreeItemPredicate<T>> predicateProperty()
public final TreeItemPredicate<T> getPredicate()
public final void setPredicate(TreeItemPredicate<T> predicate)
predicate - the predicate