Class Index | File Index

Classes


Class zwt.ui.tree.Tree


Extends zwt.ui.Widget.

A tree widget is used to display a set of hierarchical data.

An element of the tree is a zwt.ui.tree.TreeNode in the zwt.ui.tree.TreeModel. Nodes are identified by a tree path which is an array of indices defining the path to the node through the hierarchy of data.

A tree is using a zwt.ui.tree.TreeSelectionModel to handle single or multiple node selection. The selection behavior is specified in a zwt.ui.tree.TreeSelector.

Each node in the tree is rendered using a zwt.ui.tree.TreeNodeRenderer.

CSS rules

.zwt_tree {}
.zwt_tree .zwt_tree-sub {}
.zwt_tree .zwt_tree-item {}
.zwt_tree .zwt_tree-item-cursor {}
.zwt_tree .zwt_tree-item-selected {}
.zwt_tree .zwt_tree-item-dir {}
.zwt_tree .zwt_tree-item-root {}
.zwt_tree .zwt_tree-item .zwt_tree-item-indent {}
.zwt_tree .zwt_tree-item .zwt_tree-item-control {}
.zwt_tree .zwt_tree-item .zwt_tree-item-icon {}
.zwt_tree .zwt_tree-item .zwt_tree-item-label {}

Defined in: Tree.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Construct a tree.
Method Summary
Method Attributes Method Name and Description
 
Return the click event manager attached to the tree.
 
Return the tree model that provides the data displayed by the tree.
 
Return the mouse event manager attached to the tree.
 
Return the renderer used to render nodes in the tree.
 
Return the selection model used to maintain the selection state.
 
Return the selector used to select nodes in the tree.
 
Determine whether animation is enabled.
 
processClickEvent(zwt_event_ClickEvent_event)
Process the specified click event.
 
processEvent(zwt_event_Event_event)
Process the specified event.
 
processFocusEvent(zwt_event_FocusEvent_event)
Process the specified focus event.
 
processMouseEvent(zwt_event_MouseEvent_event)
Process the specified mouse event.
 
setModel(zwt_ui_tree_TreeModel_model)
Set the tree model.
 
setNodeRenderer(zwt_ui_tree_TreeNodeRenderer_renderer)
Set the tree node renderer.
 
setSelectionModel(zwt_ui_tree_TreeSelectionModel_model)
Set the selection model.
 
setSelector(zwt_ui_tree_TreeSelector_selector)
Set the tree selector.
 
setUseAnimation(boolean_flag)
Disable or enable the animation when a node is expanded or collapsed.
Methods borrowed from class zwt.ui.Widget:
addStyle, draw, getContextFill, getDimension, getElement, getElementDimension, getFill, getFocusEventManager, getId, getKeyboardEventManager, getParent, getRelativeLeft, getRelativeTop, getStyle, getWheelEventManager, hasFocus, hasStyle, isFocusable, isVisible, onEvent, processContentEvent, processKeyboardEvent, processWheelEvent, redraw, removeStyle, replaceStyle, setFill, setFocusable, setId, setStyle, setVisible
Class Detail
zwt.ui.tree.Tree()
Construct a tree.
Author: Jeremy KUHN.
See:
zwt.ui.tree.TreeModel
zwt.ui.tree.TreeSelectionModel
zwt.ui.tree.TreeSelector
zwt.ui.tree.TreeNodeRenderer
Method Detail
{zwt.event.ClickEventManager} getClickEventManager()
Return the click event manager attached to the tree.
Returns:
The click event manager

{zwt.ui.tree.TreeModel} getModel()
Return the tree model that provides the data displayed by the tree.
Returns:
The tree model

{zwt.event.MouseEventManager} getMouseEventManager()
Return the mouse event manager attached to the tree.
Returns:
The mouse event manager

{zwt.ui.tree.TreeNodeRenderer} getNodeRenderer()
Return the renderer used to render nodes in the tree.
Returns:
The tree node renderer

{zwt.ui.tree.TreeSelectionModel} getSelectionModel()
Return the selection model used to maintain the selection state.
Returns:
The selection model.

{zwt.ui.tree.TreeSelector} getSelector()
Return the selector used to select nodes in the tree.
Returns:
The selector

{Boolean} isUseAnimation()
Determine whether animation is enabled.
Returns:
true if animation is enabled, false otherwise

processClickEvent(zwt_event_ClickEvent_event)
Process the specified click event.

This method dispatches the event to the tree click event manager with the tree path of the targeted node as extra argument in order to give registered handlers an access to the targeted node.

Parameters:
{zwt.event.ClickEvent} zwt_event_ClickEvent_event
The click event to process

processEvent(zwt_event_Event_event)
Process the specified event.
Parameters:
{zwt.event.Event} zwt_event_Event_event
The event to process

processFocusEvent(zwt_event_FocusEvent_event)
Process the specified focus event.
Parameters:
{zwt.event.FocusEvent} zwt_event_FocusEvent_event
The focus event to process

processMouseEvent(zwt_event_MouseEvent_event)
Process the specified mouse event.

This method dispatches the event to the tree click event manager with the tree path of the targeted node as extra argument in order to give registered handlers an access to the targeted node.

Parameters:
{zwt.event.MouseEvent} zwt_event_MouseEvent_event
The mouse event to process

setModel(zwt_ui_tree_TreeModel_model)
Set the tree model.
Parameters:
{zwt.ui.tree.TreeModel} zwt_ui_tree_TreeModel_model
The tree model to set

setNodeRenderer(zwt_ui_tree_TreeNodeRenderer_renderer)
Set the tree node renderer.
Parameters:
{zwt.ui.tree.TreeNodeRenderer} zwt_ui_tree_TreeNodeRenderer_renderer
The renderer to set

setSelectionModel(zwt_ui_tree_TreeSelectionModel_model)
Set the selection model.
Parameters:
{zwt.ui.tree.TreeSelectionModel} zwt_ui_tree_TreeSelectionModel_model
The selection model to set.

setSelector(zwt_ui_tree_TreeSelector_selector)
Set the tree selector. A selector defines the selection behavior of the tree.

A selector is tightly linked to the tree, therefore a selector instance must not be used in several tree instances.

Parameters:
{zwt.ui.tree.TreeSelector} zwt_ui_tree_TreeSelector_selector
The selector to set

setUseAnimation(boolean_flag)
Disable or enable the animation when a node is expanded or collapsed.
Parameters:
{Boolean} boolean_flag
true to enable animation, false otherwise

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