public class CellTree extends AbstractCellTree implements HasAnimation, Focusable
This widget will only work in standards mode, which requires that the HTML page in which it is run have an explicit <!DOCTYPE> declaration.
Modifier and Type | Class and Description |
---|---|
static interface |
CellTree.BasicResources
Resources that match the GWT standard style theme.
|
static interface |
CellTree.CellTreeMessages
Constants for labeling the cell tree.
|
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.
|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasKeyboardSelectionPolicy.KeyboardSelectionPolicy
DEBUG_ID_PREFIX
Constructor and Description |
---|
CellTree(TreeViewModel viewModel,
T rootValue)
Construct a new
CellTree . |
CellTree(TreeViewModel viewModel,
T rootValue,
CellTree.Resources resources)
Construct a new
CellTree . |
CellTree(TreeViewModel viewModel,
T rootValue,
CellTree.Resources resources,
CellTree.CellTreeMessages messages)
Construct a new
CellTree . |
CellTree(TreeViewModel viewModel,
T rootValue,
CellTree.Resources resources,
CellTree.CellTreeMessages messages,
int defaultNodeSize)
Construct a new
CellTree . |
Modifier and Type | Method and Description |
---|---|
protected char |
getAccessKey()
Get the access key.
|
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 |
getKeyboardSelectedTreeNode()
Returns the TreeNode that is selected when the CellTree has keyboard focus.
|
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.
|
protected void |
onBlur()
Called when the keyboard selected node loses focus.
|
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received.
|
protected void |
onFocus()
Called when the keyboard selected node gains focus.
|
void |
setAccessKey(char key)
Sets the widget's '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 |
setKeyboardSelectedTreeNode(TreeNode parentNode,
int childIndex,
boolean stealFocus)
Sets the node that will be selected when the CellTree gains keyboard focus.
|
void |
setTabIndex(int index)
Sets the widget's position in the tab index.
|
addCloseHandler, addOpenHandler, getKeyboardSelectionPolicy, getNodeInfo, getTreeViewModel, isKeyboardSelectionDisabled, isLeaf, setKeyboardSelectionPolicy
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
fireEvent
public CellTree(TreeViewModel viewModel, T rootValue)
CellTree
.T
- the type of data in the root nodeviewModel
- the TreeViewModel
that backs the treerootValue
- the hidden root value of the treepublic CellTree(TreeViewModel viewModel, T rootValue, CellTree.Resources resources)
CellTree
. Uses default translations that means
that messages will be always in English.T
- the type of data in the root nodeviewModel
- the TreeViewModel
that backs the treerootValue
- the hidden root value of the treeresources
- the resources used to render the treepublic CellTree(TreeViewModel viewModel, T rootValue, CellTree.Resources resources, CellTree.CellTreeMessages messages)
CellTree
.T
- the type of data in the root nodeviewModel
- the TreeViewModel
that backs the treerootValue
- the hidden root value of the treeresources
- the resources used to render the treemessages
- translation messages. Users should inherit an empty interface from
CellTree.CellTreeMessages
and add annotations needed for their specific
translation systems. Then create the new interface with GWT.create and pass
as this argument.public CellTree(TreeViewModel viewModel, T rootValue, CellTree.Resources resources, CellTree.CellTreeMessages messages, int defaultNodeSize)
CellTree
.T
- the type of data in the root nodeviewModel
- the TreeViewModel
that backs the treerootValue
- the hidden root value of the treeresources
- the resources used to render the treemessages
- translation messages. Users should inherit an empty interface from
CellTree.CellTreeMessages
and add annotations needed for their specific
translation systems. Then create the new interface with GWT.create and pass
as this argument.defaultNodeSize
- default number of children to display beneath each child nodepublic CellTree.NodeAnimation getAnimation()
isAnimationEnabled()
,
setAnimation(NodeAnimation)
public int getDefaultNodeSize()
setDefaultNodeSize(int)
public TreeNode getRootTreeNode()
AbstractCellTree
TreeNode
.getRootTreeNode
in class AbstractCellTree
TreeNode
at the root of the treepublic int getTabIndex()
Focusable
getTabIndex
in interface Focusable
public boolean isAnimationEnabled()
HasAnimation
isAnimationEnabled
in interface HasAnimation
public void onBrowserEvent(Event event)
EventListener
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Composite
event
- the event receivedpublic void setAccessKey(char key)
Setting the key to (int) 0 will disable the access key.
setAccessKey
in interface Focusable
key
- the widget's access keygetAccessKey()
public void setAnimation(CellTree.NodeAnimation animation)
setAnimationEnabled(boolean)
to enable or disable animation.animation
- a CellTree.NodeAnimation
setAnimationEnabled(boolean)
,
getAnimation()
public void setAnimationEnabled(boolean enable)
HasAnimation
setAnimationEnabled
in interface HasAnimation
enable
- true to enable, false to disablepublic void setDefaultNodeSize(int defaultNodeSize)
defaultNodeSize
- the maxgetDefaultNodeSize()
public void setFocus(boolean focused)
Focusable
GWTTestCase#delayTestFinish
for more information on how to do this.public void setKeyboardSelectedTreeNode(TreeNode parentNode, int childIndex, boolean stealFocus)
parentNode
- a node in the tree that is currently openchildIndex
- the index of the child to selectstealFocus
- if true, also change keyboard focus to this CellTree.public void setTabIndex(int index)
Focusable
-1
will cause this widget to
be removed from the tab order.setTabIndex
in interface Focusable
index
- the widget's tab indexprotected char getAccessKey()
setAccessKey(char)
protected void onBlur()
protected void onFocus()
public TreeNode getKeyboardSelectedTreeNode()
Copyright © 2018. All rights reserved.