- java.lang.Object
-
- eu.ess.xaos.ui.control.tree.TreeItems
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Callback<TreeView<Path>,TreeCell<Path>>defaultTreePathCellFactory()static <T> TreeItem<T>expandAll(TreeItem<T> node, boolean expand)Expands/collapses the node and all its non-leaf children recursively.static <T> TreeTableView<T>expandAll(TreeTableView<T> treeTable, boolean expand)Expands/collapses theTreeTableViewroot node and all its non-leaf children recursively.static <T> TreeView<T>expandAll(TreeView<T> tree, boolean expand)Expands/collapses theTreeViewroot node and all its non-leaf children recursively.static <T> Optional<TreeItem<T>>find(TreeItem<T> root, Predicate<? super TreeItem<T>> predicate)static <T> Optional<TreeItem<T>>find(TreeTableView<T> tree, Predicate<? super TreeItem<T>> predicate)static <T> Optional<TreeItem<T>>find(TreeView<T> tree, Predicate<? super TreeItem<T>> predicate)static <T> Optional<TreeItem<T>>findValue(TreeItem<T> root, Predicate<? super T> predicate)static <T> Optional<TreeItem<T>>findValue(TreeTableView<T> tree, Predicate<? super T> predicate)static <T> Optional<TreeItem<T>>findValue(TreeView<T> tree, Predicate<? super T> predicate)static <T> List<TreeItem<T>>search(TreeItem<T> root, Predicate<? super TreeItem<T>> predicate)static <T> List<TreeItem<T>>search(TreeTableView<T> tree, Predicate<? super TreeItem<T>> predicate)static <T> List<TreeItem<T>>search(TreeView<T> tree, Predicate<? super TreeItem<T>> predicate)static <T> List<TreeItem<T>>searchValue(TreeItem<T> root, Predicate<? super T> predicate)static <T> List<TreeItem<T>>searchValue(TreeTableView<T> tree, Predicate<? super T> predicate)static <T> List<TreeItem<T>>searchValue(TreeView<T> tree, Predicate<? super T> predicate)
-
-
-
Method Detail
-
defaultTreePathCellFactory
public static Callback<TreeView<Path>,TreeCell<Path>> defaultTreePathCellFactory()
Returns a cell factory to be used inTreeViews whose type parameter isPath.The returned
, otherwise only the last portion of the path name is displayed (the one returned byTreeCells will show the full path name if the correspondingTreeItemis a direct child of the view's root node (the one returned byTreeView.getRoot()Path.getFileName().
-
expandAll
public static <T> TreeItem<T> expandAll(TreeItem<T> node, boolean expand)
Expands/collapses the node and all its non-leaf children recursively.This method is not thread safe, and should be called from the JavaFX application thread.
- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
node- TheTreeItemto be expanded or collapsed.expand- Iftruethe node and its children will be expanded, iffalsethey will be collapsed.- Returns:
- The passed
TreeItemnode.
-
expandAll
public static <T> TreeView<T> expandAll(TreeView<T> tree, boolean expand)
Expands/collapses theTreeViewroot node and all its non-leaf children recursively.This method is not thread safe, and should be called from the JavaFX application thread.
- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
tree- TheTreeViewwhose root node has to be expanded or collapsed.expand- Iftruethe node and its children will be expanded, iffalsethey will be collapsed.- Returns:
- The passed
TreeView.
-
expandAll
public static <T> TreeTableView<T> expandAll(TreeTableView<T> treeTable, boolean expand)
Expands/collapses theTreeTableViewroot node and all its non-leaf children recursively.This method is not thread safe, and should be called from the JavaFX application thread.
- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
treeTable- TheTreeTableViewwhose root node has to be expanded or collapsed.expand- Iftruethe node and its children will be expanded, iffalsethey will be collapsed.- Returns:
- The passed
TreeTableView.
-
find
public static <T> Optional<TreeItem<T>> find(TreeItem<T> root, Predicate<? super TreeItem<T>> predicate)
Return anOptionalobject possibly containing the first tree item from the tree rooted at the given root node, matching the givenPredicate.- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
root- The rootTreeItemwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Optionalobject possibly containing the found tree items.
-
find
public static <T> Optional<TreeItem<T>> find(TreeView<T> tree, Predicate<? super TreeItem<T>> predicate)
Return anOptionalobject possibly containing the first tree item from the giventree, matching the givenPredicate.- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
tree- TheTreeViewwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Optionalobject possibly containing the found tree items.
-
find
public static <T> Optional<TreeItem<T>> find(TreeTableView<T> tree, Predicate<? super TreeItem<T>> predicate)
Return anOptionalobject possibly containing the first tree item from the giventreetable, matching the givenPredicate.- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
tree- TheTreeTableViewwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Optionalobject possibly containing the found tree items.
-
findValue
public static <T> Optional<TreeItem<T>> findValue(TreeItem<T> root, Predicate<? super T> predicate)
Return anOptionalobject possibly containing the first tree item from the tree rooted at the given root node, whose value is matching the givenPredicate.- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
root- The rootTreeItemwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Optionalobject possibly containing the found tree items.
-
findValue
public static <T> Optional<TreeItem<T>> findValue(TreeView<T> tree, Predicate<? super T> predicate)
Return anOptionalobject possibly containing the first tree item from the giventree, whose value is matching the givenPredicate.- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
tree- TheTreeViewwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Optionalobject possibly containing the found tree items.
-
findValue
public static <T> Optional<TreeItem<T>> findValue(TreeTableView<T> tree, Predicate<? super T> predicate)
Return anOptionalobject possibly containing the first tree item from the giventreetable, whose value is matching the givenPredicate.- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
tree- TheTreeTableViewwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Optionalobject possibly containing the found tree items.
-
search
public static <T> List<TreeItem<T>> search(TreeItem<T> root, Predicate<? super TreeItem<T>> predicate)
Return aListof the tree items from the tree rooted at the given root node, matching the givenPredicate.- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
root- The rootTreeItemwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Listof the found tree items.
-
search
public static <T> List<TreeItem<T>> search(TreeView<T> tree, Predicate<? super TreeItem<T>> predicate)
- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
tree- TheTreeViewwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Listof the found tree items.
-
search
public static <T> List<TreeItem<T>> search(TreeTableView<T> tree, Predicate<? super TreeItem<T>> predicate)
- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
tree- TheTreeTableViewwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Listof the found tree items.
-
searchValue
public static <T> List<TreeItem<T>> searchValue(TreeItem<T> root, Predicate<? super T> predicate)
Return aListof the tree items from the tree rooted at the given root node, whose value is matching the givenPredicate.- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
root- The rootTreeItemwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Listof the found tree items.
-
searchValue
public static <T> List<TreeItem<T>> searchValue(TreeView<T> tree, Predicate<? super T> predicate)
- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
tree- TheTreeViewwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Listof the found tree items.
-
searchValue
public static <T> List<TreeItem<T>> searchValue(TreeTableView<T> tree, Predicate<? super T> predicate)
Return aListof the tree items from the giventreetable, whose value is matching the givenPredicate.- Type Parameters:
T- The type of the value returned byTreeItem.getValue().- Parameters:
tree- TheTreeTableViewwhere the search is performed.predicate- The predicate used to select the visited tree item.- Returns:
- The
Listof the found tree items.
-
-