classafReflux::ResourceTree

sys::Obj
  afReflux::ResourceTree

(Widget) - A tree widget that displays Resource hierarchies. ResourceTree is a wrapper around the FWT Tree widget with the following enhancements:

  • A Resource specific tree model.
  • Hassle free refreshNode() and showNode() methods that just work.
  • Event data return the Resource that's been actioned.

Because ResourceTree does not extend fwt:Widget it can not be added directly. Instead, add the tree field which returns the wrapped FWT Tree instance.

tree := ResourceTree()
ContentPane() {
    it.content = tree.tree
}
make

Source

new make(|This in)

Creates a ResourceTree.

model

Source

ResourceTreeModel model := ResourceTreeModel.<ctor>()

The model that customises the look of the tree. Leave as is for default behaviour.

onAction

Source

EventListeners onAction()

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

Event id fired:

  • EventId.modified

Event fields:

  • Event.data: the Resource actioned
onPopup

Source

EventListeners onPopup()

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:

  • EventId.popup

Event fields:

  • Event.data: the Resource selected, or null if this is a background popup.
  • Event.pos: the mouse position of the popup.
onSelect

Source

EventListeners onSelect()

Callback when selected nodes change.

Event id fired:

  • EventId.select

Event fields:

  • Event.data: the Resource selected
refreshAll

Source

Void refreshAll()

Update the entire tree's contents from the model.

refreshNode

Source

Void refreshNode(Resource resource)

Updates the specified resource from the model before showing it.

roots

Source

Resource[] roots := Resource#.emptyList

The root resources of the tree.

showNode

Source

Void showNode(Resource resource)

Scrolls and expands the tree until the Resource is visible. This also selects the resource in the tree.

tree

Source

Tree tree

The underlying FWT Tree widget.