public class

CellTree

extends AbstractCellTree
implements Focusable HasAnimation
java.lang.Object
   ↳ com.google.gwt.user.client.ui.UIObject
     ↳ com.google.gwt.user.client.ui.Widget
       ↳ com.google.gwt.user.client.ui.Composite
         ↳ com.google.gwt.user.cellview.client.AbstractCellTree
           ↳ com.google.gwt.user.cellview.client.CellTree

Class Overview

A view of a tree.

This widget will only work in standards mode, which requires that the HTML page in which it is run have an explicit <!DOCTYPE> declaration.

Examples

Trivial example
{@example com.google.gwt.examples.cellview.CellTreeExample}
Complex example
{@example com.google.gwt.examples.cellview.CellTreeExample2}

Summary

Nested Classes
interface CellTree.BasicResources Resources that match the GWT standard style theme. 
class CellTree.NodeAnimation A node animation. 
interface CellTree.Resources A ClientBundle that provides images for this widget. 
class CellTree.RevealAnimation A CellTree.NodeAnimation that reveals the contents of child nodes. 
class CellTree.SlideAnimation A CellTree.NodeAnimation that slides children into view. 
interface CellTree.Style Styles used by this widget. 
[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
Public Constructors
<T> CellTree(TreeViewModel viewModel, T rootValue)
Construct a new CellTree.
<T> CellTree(TreeViewModel viewModel, T rootValue, CellTree.Resources resources)
Construct a new CellTree.
Public Methods
CellTree.NodeAnimation getAnimation()
Get the animation used to open and close nodes in this tree if animations are enabled.
int getDefaultNodeSize()
Get the default maximum number of children to display under each tree node.
TreeNode getRootTreeNode()
Get the root TreeNode.
int getTabIndex()
Gets the widget's position in the tab index.
boolean isAnimationEnabled()
Returns true if animations are enabled, false if not.
void onBrowserEvent(Event event)
Fired whenever a browser event is received.
void setAccessKey(char key)
Sets the widget's 'access key'.

Setting the key to (int) 0 will disable the access key.

void setAnimation(CellTree.NodeAnimation animation)
Set the animation used to open and close nodes in this tree.
void setAnimationEnabled(boolean enable)
Enable or disable animations.
void setDefaultNodeSize(int defaultNodeSize)
Set the default number of children to display beneath each child node.
void setFocus(boolean focused)
Explicitly focus/unfocus this widget.
void setTabIndex(int index)
Sets the widget's position in the tab index.
Protected Methods
char getAccessKey()
Get the access key.
void onBlur()
Called when the keyboard selected node loses focus.
void onFocus()
Called when the keyboard selected node gains focus.
[Expand]
Inherited Methods
From class com.google.gwt.user.cellview.client.AbstractCellTree
From class com.google.gwt.user.client.ui.Composite
From class com.google.gwt.user.client.ui.Widget
From class com.google.gwt.user.client.ui.UIObject
From class java.lang.Object
From interface com.google.gwt.event.logical.shared.HasAttachHandlers
From interface com.google.gwt.event.logical.shared.HasCloseHandlers
From interface com.google.gwt.event.logical.shared.HasOpenHandlers
From interface com.google.gwt.event.shared.HasHandlers
From interface com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy
From interface com.google.gwt.user.client.EventListener
From interface com.google.gwt.user.client.ui.Focusable
From interface com.google.gwt.user.client.ui.HasAnimation
From interface com.google.gwt.user.client.ui.IsWidget

Public Constructors

public CellTree (TreeViewModel viewModel, T rootValue)

Construct a new CellTree.

Parameters
viewModel the TreeViewModel that backs the tree
rootValue the hidden root value of the tree

public CellTree (TreeViewModel viewModel, T rootValue, CellTree.Resources resources)

Construct a new CellTree.

Parameters
viewModel the TreeViewModel that backs the tree
rootValue the hidden root value of the tree
resources the resources used to render the tree

Public Methods

public CellTree.NodeAnimation getAnimation ()

Get the animation used to open and close nodes in this tree if animations are enabled.

Returns
  • the animation

public int getDefaultNodeSize ()

Get the default maximum number of children to display under each tree node.

Returns
  • the default node size

public TreeNode getRootTreeNode ()

Get the root TreeNode.

Returns

public int getTabIndex ()

Gets the widget's position in the tab index.

Returns
  • the widget's tab index

public boolean isAnimationEnabled ()

Returns true if animations are enabled, false if not.

public void onBrowserEvent (Event event)

Fired whenever a browser event is received.

Parameters
event the event received

public void setAccessKey (char key)

Sets the widget's 'access key'. This key is used (in conjunction with a browser-specific modifier key) to automatically focus the widget.

Setting the key to (int) 0 will disable the access key.

Parameters
key the widget's access key
See Also

public void setAnimation (CellTree.NodeAnimation animation)

Set the animation used to open and close nodes in this tree. You must call setAnimationEnabled(boolean) to enable or disable animation.

Parameters
animation a CellTree.NodeAnimation

public void setAnimationEnabled (boolean enable)

Enable or disable animations.

Parameters
enable true to enable, false to disable

public void setDefaultNodeSize (int defaultNodeSize)

Set the default number of children to display beneath each child node. If more nodes are available, a button will appear at the end of the list allowing the user to show more items. Changing this value will not affect tree nodes that are already open.

Parameters
defaultNodeSize the max

public void setFocus (boolean focused)

Explicitly focus/unfocus this widget. Only one widget can have focus at a time, and the widget that does will receive all keyboard events.

Parameters
focused whether this widget should take focus or release it

public void setTabIndex (int index)

Sets the widget's position in the tab index. If more than one widget has the same tab index, each such widget will receive focus in an arbitrary order. Setting the tab index to -1 will cause this widget to be removed from the tab order.

Parameters
index the widget's tab index

Protected Methods

protected char getAccessKey ()

Get the access key.

Returns
  • the access key, or -1 if not set

protected void onBlur ()

Called when the keyboard selected node loses focus.

protected void onFocus ()

Called when the keyboard selected node gains focus.