- 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 theTreeTableView
root node and all its non-leaf children recursively.static <T> TreeView<T>
expandAll(TreeView<T> tree, boolean expand)
Expands/collapses theTreeView
root 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 inTreeView
s whose type parameter isPath
.The returned
, otherwise only the last portion of the path name is displayed (the one returned byTreeCell
s will show the full path name if the correspondingTreeItem
is 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
- TheTreeItem
to be expanded or collapsed.expand
- Iftrue
the node and its children will be expanded, iffalse
they will be collapsed.- Returns:
- The passed
TreeItem
node.
-
expandAll
public static <T> TreeView<T> expandAll(TreeView<T> tree, boolean expand)
Expands/collapses theTreeView
root 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
- TheTreeView
whose root node has to be expanded or collapsed.expand
- Iftrue
the node and its children will be expanded, iffalse
they will be collapsed.- Returns:
- The passed
TreeView
.
-
expandAll
public static <T> TreeTableView<T> expandAll(TreeTableView<T> treeTable, boolean expand)
Expands/collapses theTreeTableView
root 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
- TheTreeTableView
whose root node has to be expanded or collapsed.expand
- Iftrue
the node and its children will be expanded, iffalse
they will be collapsed.- Returns:
- The passed
TreeTableView
.
-
find
public static <T> Optional<TreeItem<T>> find(TreeItem<T> root, Predicate<? super TreeItem<T>> predicate)
Return anOptional
object 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 rootTreeItem
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
Optional
object possibly containing the found tree items.
-
find
public static <T> Optional<TreeItem<T>> find(TreeView<T> tree, Predicate<? super TreeItem<T>> predicate)
Return anOptional
object 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
- TheTreeView
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
Optional
object possibly containing the found tree items.
-
find
public static <T> Optional<TreeItem<T>> find(TreeTableView<T> tree, Predicate<? super TreeItem<T>> predicate)
Return anOptional
object possibly containing the first tree item from the giventree
table, matching the givenPredicate
.- Type Parameters:
T
- The type of the value returned byTreeItem.getValue()
.- Parameters:
tree
- TheTreeTableView
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
Optional
object possibly containing the found tree items.
-
findValue
public static <T> Optional<TreeItem<T>> findValue(TreeItem<T> root, Predicate<? super T> predicate)
Return anOptional
object 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 rootTreeItem
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
Optional
object possibly containing the found tree items.
-
findValue
public static <T> Optional<TreeItem<T>> findValue(TreeView<T> tree, Predicate<? super T> predicate)
Return anOptional
object 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
- TheTreeView
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
Optional
object possibly containing the found tree items.
-
findValue
public static <T> Optional<TreeItem<T>> findValue(TreeTableView<T> tree, Predicate<? super T> predicate)
Return anOptional
object possibly containing the first tree item from the giventree
table, whose value is matching the givenPredicate
.- Type Parameters:
T
- The type of the value returned byTreeItem.getValue()
.- Parameters:
tree
- TheTreeTableView
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
Optional
object possibly containing the found tree items.
-
search
public static <T> List<TreeItem<T>> search(TreeItem<T> root, Predicate<? super TreeItem<T>> predicate)
Return aList
of 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 rootTreeItem
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
List
of 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
- TheTreeView
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
List
of 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
- TheTreeTableView
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
List
of the found tree items.
-
searchValue
public static <T> List<TreeItem<T>> searchValue(TreeItem<T> root, Predicate<? super T> predicate)
Return aList
of 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 rootTreeItem
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
List
of 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
- TheTreeView
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
List
of the found tree items.
-
searchValue
public static <T> List<TreeItem<T>> searchValue(TreeTableView<T> tree, Predicate<? super T> predicate)
Return aList
of the tree items from the giventree
table, whose value is matching the givenPredicate
.- Type Parameters:
T
- The type of the value returned byTreeItem.getValue()
.- Parameters:
tree
- TheTreeTableView
where the search is performed.predicate
- The predicate used to select the visited tree item.- Returns:
- The
List
of the found tree items.
-
-