Class Index | File Index

Classes


Class zwt.ui.tree.TreeModel


Extends zwt.Object.

A tree model holds the hierarchical data displayed in a tree.

Basically the model is queried by the tree to get the tree nodes to display. Tree nodes are identified by a tree path which is an array of indices defining the path to the node through the hierarchy of data.

Nodes are stored under a root node hold by the model. You can choose to display the root node in the tree in order to provide a title.


Defined in: TreeModel.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Construct a tree model.
Method Summary
Method Attributes Method Name and Description
 
collapse(array_treePath)
Collapse the node at the specified location.
 
collapseAll(array_treePath)
Collapse all the nodes under the node at the specified location.
 
expand(array_treePath)
Expand the node at the specified location.
 
expandAll(array_treePath)
Expand all the nodes under the node at the specified location.
 
getNode(array_treePath)
Return the node pointed by the specified tree path or null if there's no node in the model at this location.
 
Return the root node.
 
Return the tree model event manager attached to the model.
 
Determine whether the root node should be displayed in the tree.
 
onEvent(zwt_ui_tree_TreeModelEvent_event)
Dispatch the specified tree model event to the appropriate event manager.
 
setDisplayRoot(boolean_displayRoot)
Set whether the root node should be displayed.
 
setRootNode(zwt_ui_tree_TreeNode_node)
Set the root node of the model.
 
toggleExpand(array_treePath)
Expand or collapse the node at the specified location.
Class Detail
zwt.ui.tree.TreeModel()
Construct a tree model.
Author: Jeremy KUHN.
See:
zwt.ui.tree.Tree
zwt.ui.tree.TreeNode
zwt.ui.tree.TreeModelEvent
Method Detail
collapse(array_treePath)
Collapse the node at the specified location.
Parameters:
{Integer[]} array_treePath
A tree path

collapseAll(array_treePath)
Collapse all the nodes under the node at the specified location.
Parameters:
{Integer[]} array_treePath
A tree path

expand(array_treePath)
Expand the node at the specified location.
Parameters:
{Integer[]} array_treePath
A tree path

expandAll(array_treePath)
Expand all the nodes under the node at the specified location.
Parameters:
{Integer[]} array_treePath
A tree path

{zwt.ui.tree.TreeNode} getNode(array_treePath)
Return the node pointed by the specified tree path or null if there's no node in the model at this location.
Parameters:
{Integer[]} array_treePath
A tree path
Returns:
The node at the specified location or null

{zwt.ui.tree.TreeNode} getRootNode()
Return the root node.
Returns:
The root node

{zwt.ui.tree.TreeModelEventManager} getTreeModelEventManager()
Return the tree model event manager attached to the model.
Returns:
The tree model event manager

{boolean} isDisplayRoot()
Determine whether the root node should be displayed in the tree.
Returns:
true if the root node should be displayed, false otherwise

onEvent(zwt_ui_tree_TreeModelEvent_event)
Dispatch the specified tree model event to the appropriate event manager.
Parameters:
{zwt.ui.tree.TreeModelEvent} zwt_ui_tree_TreeModelEvent_event
The tree model event to dispatch

{Boolean} setDisplayRoot(boolean_displayRoot)
Set whether the root node should be displayed.
Parameters:
{Boolean} boolean_displayRoot
true to make the tree display the root node

setRootNode(zwt_ui_tree_TreeNode_node)
Set the root node of the model.
Parameters:
{zwt.ui.tree.TreeNode} zwt_ui_tree_TreeNode_node
The root node to set

toggleExpand(array_treePath)
Expand or collapse the node at the specified location.
Parameters:
{Integer[]} array_treePath
A tree path

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Jan 12 2012 02:07:54 GMT+0100 (CET)