Class zwt.ui.tree.TreeSelector
Extends
zwt.Object.
A tree selector defines the selection behavior in a tree. Basically, a user select data in a tree by selecting a node using the keyboard or the mouse. The tree relies on a selector to update the selection model based on these user actions.
It also provides a bridge between the view and the model. It actually converts user interaction on the elements in the view to the nodes to select and/or deselect in the model.
This default implementation supports standard single and multiple nodes selection with standard meta keys behavior. You may want to provide your own implementation to select nodes differently.
Defined in: TreeSelector.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Construct a tree selector.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
zwt.ui.tree.TreeSelector.MULTIPLE_SELECTION
Indicate a multiple selection mode.
|
<static> |
zwt.ui.tree.TreeSelector.SINGLE_SELECTION
Indicate a single selection mode.
|
Method Attributes | Method Name and Description |
---|---|
Return the current base tree path.
|
|
Return the selection mode of the selector.
|
|
getTree()
Return the tree associated to the selector.
|
|
select(array_treePath, boolean_shift, boolean_ctrl)
Update the selection model attached to a tree based on the specified tree path and set of meta-keys the user may have used.
|
|
setSelectionMode(int_mode)
Set the selection mode of the selector.
|
The base tree path is used as the origin in a group selection (with Shift meta-key).
- Returns:
- the base tree path
In a zwt.ui.tree.TreeSelector.SINGLE_SELECTION mode, the selector select only one node at time.
In a zwt.ui.tree.TreeSelector.MULTI_SELECTION mode, the selector can select multiple node at time, allowing grouping or non contiguous selections.
- Returns:
- The selection mode
- Returns:
- The tree
This method should notify the selection model with the nodes to select and/or deselect.
- Parameters:
- {Integer[]} array_treePath
- The tree path to consider
- {Boolean} boolean_shift
- true if the Shift meta is active
- {Boolean} boolean_ctrl
- true if the Ctrl meta is active
- Parameters:
- {Integer} int_mode
- The selection mode to set (one of zwt.ui.tree.TreeSelector.SINGLE_SELECTION or zwt.ui.tree.TreeSelector.MULTIPLE_SELECTION)