class fwt::Tree

sys::Obj
  fwt::Widget
    fwt::Tree

@Serializable

Source

Tree displays a hierarchy of tree nodes which can be expanded and collapsed.

bg

const Color? bg := null

Source

Background color of tree, or null for platform default.

border

const Bool border := true

Source

Draw a border around the widget. Default is true. This field cannot be changed once the widget is constructed.

hbar

@Transient
ScrollBar hbar := ... { private set }

Source

Horizontal scroll bar.

isExpanded

Bool isExpanded(Obj node)

Source

Return the expanded state for this node.

make

new make(|This|? f := null)

Source

Default constructor.

model

TreeModel model := TreeModel.<ctor>()

Source

Backing data model of tree.

multi

const Bool multi := false

Source

True to enable multi-node selection, false for single node selection. Default is false. This field cannot be changed once the widget is constructed.

nodeAt

Obj? nodeAt(Point pos)

Source

Return the tree node at the specified coordinate relative to this widget. Return null if no node at given coordinate.

onAction

EventListeners onAction()

Source

Callback when node is double clicked or Return/Enter key is pressed.

Event id fired:

Event fields:

onPopup

EventListeners onPopup()

Source

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, or null if this is a background popup.
  • Event.pos: the mouse position of the popup.
onSelect

EventListeners onSelect()

Source

Callback when selected nodes change.

Event id fired:

Event fields:

refreshAll

Void refreshAll()

Source

Update the entire tree's contents from the model.

refreshNode

Void refreshNode(Obj node)

Source

Update the specified node from the model.

select

Void select(Obj node)

Source

Select the given item in the tree.

selected

Obj[] selected

Source

Get and set the selected nodes.

setExpanded

Void setExpanded(Obj node, Bool expanded)

Source

Set the expanded state for this node.

show

Void show(Obj node)

Source

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

vbar

@Transient
ScrollBar vbar := ... { private set }

Source

Vertical scroll bar.