com.google.gwt.user.cellview.client
Class CellTree

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by com.google.gwt.user.cellview.client.CellTree
All Implemented Interfaces:
HasHandlers, EventListener, HasAnimation

public class CellTree
extends Composite
implements HasAnimation

A view of a tree.


Nested Class Summary
static interface CellTree.CleanResources
          A cleaner version of the table that uses less graphics.
static interface CellTree.CleanStyle
          A cleaner version of the table that uses less graphics.
static class CellTree.NodeAnimation
          A node animation.
static interface CellTree.Resources
          A ClientBundle that provides images for this widget.
static class CellTree.RevealAnimation
          A CellTree.NodeAnimation that reveals the contents of child nodes.
static class CellTree.SlideAnimation
          A CellTree.NodeAnimation that slides children into view.
static interface CellTree.Style
          Styles used by this widget.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
CellTree(TreeViewModel viewModel, T rootValue)
          Construct a new CellTree.
CellTree(TreeViewModel viewModel, T rootValue, CellTree.Resources resources)
          Construct a new CellTree.
 
Method Summary
 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.
 TreeViewModel getTreeViewModel()
           
 boolean isAnimationEnabled()
           
 void onBrowserEvent(Event event)
          Fired whenever a browser event is received.
 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.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
fireEvent, getLayoutData, getParent, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CellTree

public CellTree(TreeViewModel viewModel,
                T rootValue)
Construct a new CellTree.

Type Parameters:
T - the type of data in the root node
Parameters:
viewModel - the TreeViewModel that backs the tree
rootValue - the hidden root value of the tree

CellTree

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

Type Parameters:
T - the type of data in the root node
Parameters:
viewModel - the TreeViewModel that backs the tree
rootValue - the hidden root value of the tree
resources - the resources used to render the tree
Method Detail

getAnimation

public CellTree.NodeAnimation getAnimation()
Get the animation used to open and close nodes in this tree if animations are enabled.

Returns:
the animation
See Also:
isAnimationEnabled()

getDefaultNodeSize

public int getDefaultNodeSize()
Get the default maximum number of children to display under each tree node.

Returns:
the default node size

getTreeViewModel

public TreeViewModel getTreeViewModel()

isAnimationEnabled

public boolean isAnimationEnabled()
Specified by:
isAnimationEnabled in interface HasAnimation
Returns:
true if animations are enabled, false if not

onBrowserEvent

public void onBrowserEvent(Event event)
Description copied from interface: EventListener
Fired whenever a browser event is received.

Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Composite
Parameters:
event - the event received

setAnimation

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
See Also:
setAnimationEnabled(boolean)

setAnimationEnabled

public void setAnimationEnabled(boolean enable)
Description copied from interface: HasAnimation
Enable or disable animations.

Specified by:
setAnimationEnabled in interface HasAnimation
Parameters:
enable - true to enable, false to disable

setDefaultNodeSize

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