Tree
Tree displays a set of hierarchical data, contains nodes
(not only one root node is allowed), and a node could have subnodes.
It internally handles scrolling.
The following example shows a tree with 2 root nodes ('Node A', and 'Node D'),
the first has 2 subnodes (a selected 'Node B' and 'Node C'), the collapsed
'Node D' includes one node. <tree selection="multiple">
<node text="Node A" icon="image.gif">
<node text="Node B" icon="image.gif" selected="true" />
<node text="Node C" icon="image.gif" />
</node>
<node text="Node D" expanded="false">
<node text="Node E" icon="image.gif" />
</node>
</tree>
Properties
selection | choice | single | Possible values are: single, interval, and multiple. For the default
single value the selection can only contain one path at a time,
for interval the selection can only be contiguous (of the currently
visible nodes), and for the multiple value the selection can contain
any number of nodes that are not necessarily contiguous. |
angle | boolean | false | To specify to draw lines detailing the relationships between nodes. |
line, and selection parameters are similar to list |
name, enabled, visible, tooltip, property, width, height, colspan, rowspan,
weightx, weighty, halign, and valign parameters are similar to
component |
Listeners
action | Calls the method whenever the selection changes. |
perform | Calls the method whenever a double-click event occurs. |
expand | The listener that's notified when the tree expands a node. |
collapse | Called whenever a node in the tree has been collapsed. |
Node
Tree node is similar to list item, but maybe contains subnodes, and has
collapse control.
Properties
selected | boolean | false | True if currently selected. |
expanded | boolean | true | Ensures that the node is expanded if true, otherwise collapsed. |
name, enabled, text, icon, alignment, tooltip, and property parameters
are similar to combobox choice |
Keyboard-actions
Right arrow | Expands current collapsed node, or selects its first subnode |
Left arrow | Collapses current expanded node, or selects its parent node |
Up arrow | Selects previous node |
Down arrow | Selects next node |
Home | Selects first node |
End | Selects last node |
Page Up | Selects node one view up |
Page Down | Selects node one view down |
+Shift | Extends selection |
+Ctrl | Set lead node |
Space | Selects lead node |
Ctrl-A, Ctrl-Slash | Selects all |
Ctrl-Backslash | Deselects all |
Tab, Shift-Tab | Navigate forward, backward |
|