Class Index | File Index

Classes


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.

Class Summary
Constructor Attributes Constructor Name and Description
 
Construct a tree selector.
Field Summary
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 Summary
Method Attributes Method Name and Description
 
Return the current base tree path.
 
Return the selection mode of the selector.
 
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.
Class Detail
zwt.ui.tree.TreeSelector()
Construct a tree selector.
Author: Jeremy KUHN.
See:
zwt.ui.tree.Tree
zwt.ui.tree.TreeSelectionModel
Field Detail
<static> {Integer} zwt.ui.tree.TreeSelector.MULTIPLE_SELECTION
Indicate a multiple selection mode. Multiple nodes can be selected at a time.

<static> {Integer} zwt.ui.tree.TreeSelector.SINGLE_SELECTION
Indicate a single selection mode. Only one node can be selected at a time.
Method Detail
{Integer[]} getBaseTreePath()
Return the current base tree path. The base tree path represents the path to the last node selected in the Tree.

The base tree path is used as the origin in a group selection (with Shift meta-key).

Returns:
the base tree path

{Integer} getSelectionMode()
Return the selection mode of the selector.

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

{zwt.ui.tree.Tree} getTree()
Return the tree associated to the selector.
Returns:
The tree

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. This method is basically called by the tree, you should never call it directly.

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

setSelectionMode(int_mode)
Set the selection mode of the selector.
Parameters:
{Integer} int_mode
The selection mode to set (one of zwt.ui.tree.TreeSelector.SINGLE_SELECTION or zwt.ui.tree.TreeSelector.MULTIPLE_SELECTION)

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Nov 09 2011 19:29:09 GMT+0100 (CET)