Package com.tonic.vellum.widget
Class TreeNode
- java.lang.Object
-
- com.tonic.vellum.widget.TreeNode
-
public final class TreeNode extends java.lang.ObjectA node in a TreeView: a label, ordered children, and an expanded flag.
-
-
Constructor Summary
Constructors Constructor Description TreeNode(java.lang.String label)Creates a leaf node with the given label.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TreeNodeadd(TreeNode child)Appends a child node.java.util.List<TreeNode>children()TreeNodeexpanded(boolean expanded)Sets whether this node is expanded.booleanisExpanded()booleanisLeaf()java.lang.Stringlabel()
-
-
-
Method Detail
-
add
public TreeNode add(TreeNode child)
Appends a child node.- Parameters:
child- the child node to add- Returns:
- this TreeNode for chaining
-
label
public java.lang.String label()
- Returns:
- the label text
-
children
public java.util.List<TreeNode> children()
- Returns:
- an unmodifiable list of the children, in order
-
isLeaf
public boolean isLeaf()
- Returns:
trueif this node has no children
-
isExpanded
public boolean isExpanded()
- Returns:
trueif expanded
-
expanded
public TreeNode expanded(boolean expanded)
Sets whether this node is expanded.- Parameters:
expanded- the new state- Returns:
- this TreeNode for chaining
-
-