TreeNode

Fundamental building block of Tree structures.

API

TreeNode.java
class TreeNode<T> {
  TreeNode<T> root(T value, TreeAdapter<T> treeAdapter, TreeState sharedState)
  TreeNode<T> root(T value, Class<? extends TreeAdapter<T>> treeAdapterClass, TreeState sharedState, FactoryService factoryService)
  T getRootValue()
  T getValue()
  int getIncomingCount()
  int getOutgoingCount()
  Stream<Edge<T>> streamIncoming()
  Stream<Edge<T>> streamOutgoing()
  Optional<TreeNode<T>> resolve(TreePath absolutePath)     (1)
  Optional<TreeNode<T>> lookupParent()
  int getChildCount()
  Stream<TreeNode<T>> streamChildren()
  boolean isLeaf()
  TreePath getPositionAsPath()
  TreeState getTreeState()     (2)
  boolean isExpanded(TreePath treePath)
  void expand(TreePath... treePaths)     (3)
  void expand()     (4)
  void collapse(TreePath... treePaths)     (5)
  void clearSelection()     (6)
  boolean isSelected(TreePath treePath)     (7)
  void select(TreePath... treePaths)     (8)
  TreeNode<T> root(T rootNode, TreeAdapter<T> treeAdapter)     (9)
  TreeNode<T> root(T rootNode, Class<? extends TreeAdapter<T>> treeAdapterClass, FactoryService factoryService)     (10)
  Iterator<TreeNode<T>> iteratorHierarchyUp()
  Stream<TreeNode<T>> streamHierarchyUp()
  Iterator<TreeNode<T>> iteratorDepthFirst()
  Iterator<TreeNode<T>> iteratorBreadthFirst()
  Stream<TreeNode<T>> streamDepthFirst()
  Stream<TreeNode<T>> streamBreadthFirst()
}
1 resolve(TreePath)

Resolves given path relative to the root of this tree.

2 getTreeState()
3 expand(TreePath)

Adds treePaths to the set of expanded nodes, as held by this tree’s shared state object.

4 expand()

Expands this node and all its parents.

5 collapse(TreePath)

Removes treePaths from the set of expanded nodes, as held by this tree’s shared state object.

6 clearSelection()

Clears all selection markers.

7 isSelected(TreePath)

Whether node that corresponds to given TreePath has a selection marker.

8 select(TreePath)

Select nodes by their corresponding TreePath , that is, activate their selection marker.

9 root(T, TreeAdapter)

Creates the root node of a tree structure as inferred from given treeAdapter.

10 root(T, Class, FactoryService)

Creates the root node of a tree structure as inferred from given treeAdapter.

Members

resolve(TreePath)

Resolves given path relative to the root of this tree.

getTreeState()

expand(TreePath)

Adds treePaths to the set of expanded nodes, as held by this tree’s shared state object.

expand()

Expands this node and all its parents.

collapse(TreePath)

Removes treePaths from the set of expanded nodes, as held by this tree’s shared state object.

clearSelection()

Clears all selection markers.

isSelected(TreePath)

Whether node that corresponds to given TreePath has a selection marker.

select(TreePath)

Select nodes by their corresponding TreePath , that is, activate their selection marker.

With the Wicket Viewer corresponds to expressing CSS class tree-node-selected on the rendered tree node, which has default bg-color lightgrey . Color can be customized by setting CSS var __

.tree-theme-bootstrap .tree-node-selected {
    background-color: var(--tree-node-selected-bg-color, lightgrey);
}

root(T, TreeAdapter)

Creates the root node of a tree structure as inferred from given treeAdapter.

root(T, Class, FactoryService)

Creates the root node of a tree structure as inferred from given treeAdapter.