TreeNode

Fundamental building block of Tree structures.

API

TreeNode.java
class TreeNode<T> {
  TreeNode<T> of(T value, Class<? extends TreeAdapter<T>> treeAdapterClass, TreeState sharedState)
  T getValue()
  int getIncomingCount()
  int getOutgoingCount()
  Stream<Edge<T>> streamIncoming()
  Stream<Edge<T>> streamOutgoing()
  TreeNode<T> getParentIfAny()
  int getChildCount()
  Stream<TreeNode<T>> streamChildren()
  boolean isRoot()
  boolean isLeaf()
  TreePath getPositionAsPath()
  TreeState getTreeState()     (1)
  boolean isExpanded(TreePath treePath)
  void expand(TreePath... treePaths)     (2)
  void expand()     (3)
  void collapse(TreePath... treePaths)     (4)
  void clearSelection()     (5)
  boolean isSelected(TreePath treePath)     (6)
  void select(TreePath... treePaths)     (7)
  TreeNode<T> lazy(T node, Class<? extends TreeAdapter<T>> treeAdapterClass)     (8)
  Iterator<TreeNode<T>> iteratorHierarchyUp()
  Stream<TreeNode<T>> streamHierarchyUp()
  Iterator<TreeNode<T>> iteratorDepthFirst()
  Iterator<TreeNode<T>> iteratorBreadthFirst()
  Stream<TreeNode<T>> streamDepthFirst()
  Stream<TreeNode<T>> streamBreadthFirst()
  Class<? extends TreeAdapter<T>> getTreeAdapterClass()     (9)
}
1 getTreeState()
2 expand(TreePath)

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

3 expand()

Expands this node and all its parents.

4 collapse(TreePath)

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

5 clearSelection()

Clears all selection markers.

6 isSelected(TreePath)

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

7 select(TreePath)

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

8 lazy(T, Class)

Convenient shortcut.

9 getTreeAdapterClass()

Members

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);
}

lazy(T, Class)

Convenient shortcut.

getTreeAdapterClass()