@Serializable {
simple=false
collection=false
}
Tree displays a hierarchy of tree nodes which can be expanded and collapsed.
Slots
- borderSource
-
const Bool border := true
Draw a border around the widget. Default is true. This field cannot be changed once the widget is constructed.
- hbarSource
-
@Transient
readonly ScrollBar hbarHorizontal scroll bar.
- makeSource
-
new make(|This|? f := null)
Default constructor.
- modelSource
-
TreeModel model := TreeModel()
Backing data model of tree.
- multiSource
-
const Bool multi := false
True to enable multi-node selection, false for single node selection. Default is false. This field cannot be changed once the widget is constructed.
- nodeAtSource
-
Return the tree node at the specified coordinate relative to this widget. Return null if no node at given coordinate.
- onActionSource
-
@Transient
readonly EventListeners onAction := EventListeners()Callback when node is double clicked or Return/Enter key is pressed.
Event id fired:
Event fields:
Event.data
: theTreeModel
node object
- onPopupSource
-
@Transient
readonly EventListeners onPopup := EventListeners()Callback when user invokes a right click popup action. If the callback wishes to display a popup, then set the
Event.popup
field with menu to open. If multiple callbacks are installed, the first one to return a nonnull popup consumes the event.Event id fired:
Event fields:
Event.data
: the primary selection node object, ornull
if this is a background popup.Event.pos
: the mouse position of the popup.
- onSelectSource
-
@Transient
readonly EventListeners onSelect := EventListeners()Callback when selected nodes change.
Event id fired:
Event fields:
Event.data
: the primary selection node object.
- refreshAllSource
-
native Void refreshAll()
Update the entire tree's contents from the model.
- refreshNodeSource
-
native Void refreshNode(Obj node)
Update the specified node from the model.
- selectSource
-
Select the given item in the tree.
- selectedSource
-
native Obj[] selected
Get and set the selected nodes.
- setExpandedSource
-
native Void setExpanded(Obj node, Bool expanded)
Set the expanded state for this node.
- showSource
-
Shows the node. If the node is already showing in the tree, this method simply returns. Otherwise, the items are scrolled and expanded until the node is visible
- vbarSource
-
@Transient
readonly ScrollBar vbarVertical scroll bar.