TreeViewNode
Hierarchical node item in a TreeView holding text, custom icon, expansion state, and child nodes.
Overview
Hierarchical node item in a TreeView holding text, custom icon, expansion state, and child nodes. Provides extensive layout configuration and interaction capabilities.
Basic Usage
TreeViewNode node = new TreeViewNode("Folder");
node.folder(true).expanded(true);
node.addChild("file.txt");
Related links
- TreeView: Hierarchical tree container rendering collapsable nodes with custom icons, inline editing, and selection.
API
TreeViewNode()
Constructs an empty TreeViewNode with empty label.
TreeViewNode(RichText)
Constructs a TreeViewNode with a RichText label.
| Parameter | Type | Description |
|---|---|---|
text |
RichText |
The rich text label. |
TreeViewNode(String)
Constructs a TreeViewNode with a plain text label.
| Parameter | Type | Description |
|---|---|---|
text |
String |
The text label. |
TreeViewNode::addChild(RichText)
Creates and appends a child node with RichText label.
| Parameter | Type | Description |
|---|---|---|
text |
RichText |
The rich text label. |
Returns TreeViewNode: The child tree node instance..
TreeViewNode::addChild(String)
Creates and appends a child node with plain text label.
| Parameter | Type | Description |
|---|---|---|
text |
String |
The text label. |
Returns TreeViewNode: The child tree node instance..
TreeViewNode::addChild(TreeViewNode)
Appends an existing node as a child.
| Parameter | Type | Description |
|---|---|---|
child |
TreeViewNode |
The child node instance. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::child(int)
Returns the child node at the specified index.
| Parameter | Type | Description |
|---|---|---|
index |
int |
The index position. |
Returns TreeViewNode: The child tree node instance..
TreeViewNode::childCount()
Returns the number of child nodes under this node.
Returns int: The number of child nodes..
TreeViewNode::children()
Returns an unmodifiable list of child nodes.
Returns List: An unmodifiable list of child nodes..
TreeViewNode::clearChildren()
Removes all child nodes from this node.
Returns TreeViewNode: This instance for chaining..
TreeViewNode::depth()
Returns the nesting depth of this node from the root.
Returns int: The nesting depth level..
TreeViewNode::emptyFolder()
Returns true if this node is configured to display as an empty folder.
Returns boolean: True if configured as an empty folder..
TreeViewNode::emptyFolder(boolean)
Sets whether this node displays folder semantics even without children.
| Parameter | Type | Description |
|---|---|---|
emptyFolder |
boolean |
Whether the node displays as an empty folder. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::expanded()
Returns true if this node is currently expanded.
Returns boolean: True if expanded; false otherwise..
TreeViewNode::expanded(boolean)
Expands or collapses this node, rebuilding tree rows.
| Parameter | Type | Description |
|---|---|---|
expanded |
boolean |
Whether the node or panel is expanded. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::folder()
Returns true if this node is explicitly designated as a folder.
Returns boolean: True if designated as a folder node..
TreeViewNode::folder(boolean)
Designates whether this node represents a folder item.
| Parameter | Type | Description |
|---|---|---|
isFolder |
boolean |
Whether the node is designated as a folder. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::hasChildren()
Returns true if this node has one or more children.
Returns boolean: True if child nodes are present..
TreeViewNode::icon()
Returns the texture handle icon for this node.
Returns TextureHandle: The texture icon handle..
TreeViewNode::icon(TextureHandle)
Sets the texture icon for this node.
| Parameter | Type | Description |
|---|---|---|
icon |
TextureHandle |
The icon identifier or handle. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::iconDraw()
Returns the custom icon draw callback.
Returns IconDraw: The custom icon draw callback..
TreeViewNode::iconDraw(IconDraw)
Sets a custom icon draw callback.
| Parameter | Type | Description |
|---|---|---|
iconDraw |
IconDraw |
The custom icon draw callback. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::iconSuppressed()
Returns true if icon rendering is explicitly suppressed for this node.
Returns boolean: True if icon display is suppressed..
TreeViewNode::insertChild(int, TreeViewNode)
Inserts a child node at the given index.
| Parameter | Type | Description |
|---|---|---|
index |
int |
The index position. |
child |
TreeViewNode |
The child node instance. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::isAncestor(TreeViewNode)
Returns true if this node is an ancestor of the candidate node.
| Parameter | Type | Description |
|---|---|---|
candidate |
TreeViewNode |
The candidate tree node. |
Returns boolean: True if this node is an ancestor of the candidate..
TreeViewNode::noIcon()
Explicitly suppresses icon rendering on this node.
Returns TreeViewNode: This instance for chaining..
TreeViewNode::owner()
Returns the TreeView that owns this node.
Returns TreeView: The owning TreeView container..
TreeViewNode::parent()
Returns the parent node in the hierarchy, or null if root.
Returns TreeViewNode: The parent tree node, or null if root..
TreeViewNode::removeChild(TreeViewNode)
Removes the specified child node from this node.
| Parameter | Type | Description |
|---|---|---|
child |
TreeViewNode |
The child node instance. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::richText()
Returns the RichText representation of this node label.
Returns RichText: The rich text representation..
TreeViewNode::richText(RichText)
Sets the RichText label of this node.
| Parameter | Type | Description |
|---|---|---|
text |
RichText |
The rich text label. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::rowButton()
Returns the button widget rendering this node row, or null if not currently visible.
Returns Button: The button widget rendering the row, or null..
TreeViewNode::selectable()
Returns true if this node can be selected by user interaction.
Returns boolean: True if selection is enabled..
TreeViewNode::selectable(boolean)
Sets whether this node can be selected.
| Parameter | Type | Description |
|---|---|---|
selectable |
boolean |
Whether selection is allowed. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::silentExpanded(boolean)
Sets the expanded state without triggering row rebuilds.
| Parameter | Type | Description |
|---|---|---|
expanded |
boolean |
Whether the node or panel is expanded. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::text()
Returns the plain text representation of this node label.
Returns String: The plain text label string..
TreeViewNode::text(String)
Sets the plain text label of this node.
| Parameter | Type | Description |
|---|---|---|
text |
String |
The text label. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::toggleExpanded()
Toggles the expanded state of this node.
Returns TreeViewNode: This instance for chaining..
TreeViewNode::userData()
Returns the arbitrary user data object attached to this node.
Returns Object: The attached user data object..
TreeViewNode::userData(Class)
Returns typed user data attached to this node, or null if cast fails.
| Parameter | Type | Description |
|---|---|---|
type |
Class |
The type or category string. |
Returns Object: The typed user data, or null..
TreeViewNode::userData(Object)
Attaches arbitrary user data to this node.
| Parameter | Type | Description |
|---|---|---|
userData |
Object |
The arbitrary user data object. |
Returns TreeViewNode: This instance for chaining..
TreeViewNode::value()
Returns the semantic identifier string value of this node.
Returns String: The semantic identifier value..
TreeViewNode::value(String)
Sets the semantic identifier string value of this node.
| Parameter | Type | Description |
|---|---|---|
value |
String |
The semantic value. |
Returns TreeViewNode: This instance for chaining..