Class CellTreeNodeView<T>
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.cellview.client.CellTreeNodeView<T>
- Type Parameters:
T- the type that this view contains
- All Implemented Interfaces:
HasVisibility
A view of a tree node.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classTheHasDataused to show children.(package private) static interface(package private) static classAn implementation ofTreeNodethat delegates to aCellTreeNodeView.Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled -
Field Summary
FieldsModifier and TypeFieldDescription(package private) CellTreeNodeView.NodeCellList<?>The list view used to display the nodes.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionCellTreeNodeView(CellTree tree, CellTreeNodeView<?> parent, TreeViewModel.NodeInfo<T> parentNodeInfo, Element elem, T value, CellTree.CellTreeMessages messages) Construct aCellTreeNodeView. -
Method Summary
Modifier and TypeMethodDescription(package private) booleanbelongsToTree(CellTree tree) protected voidcleanup(boolean destroy) Unregister the list handler and destroy all child nodes.protected booleanprotected <C> CellTreeNodeView<C>createTreeNodeView(TreeViewModel.NodeInfo<C> nodeInfo, Element childElem, C childValue, Object viewData) Returns an instance of TreeNodeView of the same subclass as the calling object.(package private) ElementEnsure that the animation frame exists and return it.(package private) ElementEnsure that the child container exists and return it.(package private) ElementEnsure that the content container exists and return it.protected voidfireEventToCell(NativeEvent event) Fire an event to theAbstractCell.protected ElementReturns the element that parents the cell contents of this node.intgetChildNode(int childIndex) protected ElementReturns the element corresponding to the open/close image.(package private) intgetIndex()Return the index of this node in its parent.(package private) CellTreeNodeView<?>Return the parent node, or null if this node is the root.protected ElementReturns the element that selection styles are applied to.(package private) static ElementgetSelectionElement(Element nodeElem) Returns the element that selection is applied to.(package private) Element(package private) TreeNodeGet aTreeNodewith a public API for this node view.protected ObjectReturns the key for the value of this node using the parent's implementation of NodeInfo.getKey().(package private) intindexOf(CellTreeNodeView<?> child) (package private) booleanbooleanisLeaf()booleanisOpen()Check whether or not this node is open.(package private) booleanCheck if this node is a root node.(package private) booleanCheck if the value of this node is selected.protected <C> voidonOpen(TreeViewModel.NodeInfo<C> nodeInfo) Set up the node when it is opened.(package private) booleanReset focus on this node.(package private) voidsetKeyboardSelected(boolean selected, boolean stealFocus) Select or deselect this node with the keyboard.(package private) voidsetKeyboardSelectedStyle(boolean selected) Add or remove the keyboard selected style.booleansetOpen(boolean open, boolean fireEvents) Sets whether this item's children are displayed.(package private) voidsetSelected(boolean selected) Select or deselect this node.(package private) void(package private) voidshowMore()Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, sinkEvents, toString, unsinkEvents
-
Field Details
-
listView
CellTreeNodeView.NodeCellList<?> listViewThe list view used to display the nodes.
-
-
Constructor Details
-
CellTreeNodeView
CellTreeNodeView(CellTree tree, CellTreeNodeView<?> parent, TreeViewModel.NodeInfo<T> parentNodeInfo, Element elem, T value, CellTree.CellTreeMessages messages) Construct aCellTreeNodeView.- Parameters:
tree- the parentCellTreeNodeViewparent- the parentCellTreeNodeViewparentNodeInfo- theTreeViewModel.NodeInfoof the parentelem- the outer element of thisCellTreeNodeViewvalue- the value of this nodemessages- translation messages
-
-
Method Details
-
getSelectionElement
Returns the element that selection is applied to.- Parameters:
nodeElem- the element that represents the node- Returns:
- the cell parent within the node
-
getChildCount
public int getChildCount() -
getChildNode
-
isLeaf
public boolean isLeaf() -
isOpen
public boolean isOpen()Check whether or not this node is open.- Returns:
- true if open, false if closed
-
setOpen
public boolean setOpen(boolean open, boolean fireEvents) Sets whether this item's children are displayed.- Parameters:
open- whether the item is openfireEvents- true to fire events if the state changes- Returns:
- true if successfully opened, false otherwise.
-
cleanup
protected void cleanup(boolean destroy) Unregister the list handler and destroy all child nodes.- Parameters:
destroy- true to destroy this node
-
consumeAnimate
protected boolean consumeAnimate() -
createTreeNodeView
protected <C> CellTreeNodeView<C> createTreeNodeView(TreeViewModel.NodeInfo<C> nodeInfo, Element childElem, C childValue, Object viewData) Returns an instance of TreeNodeView of the same subclass as the calling object.- Type Parameters:
C- the data type of the node's children- Parameters:
nodeInfo- a NodeInfo object describing the child nodeschildElem- the DOM element used to parent the new TreeNodeViewchildValue- the child's valueviewData- view data associated with the node- Returns:
- a TreeNodeView of suitable type
-
fireEventToCell
Fire an event to theAbstractCell.- Parameters:
event- the native event
-
getCellParent
Returns the element that parents the cell contents of this node. -
getImageElement
Returns the element corresponding to the open/close image.- Returns:
- the open/close image element
-
getSelectionElement
Returns the element that selection styles are applied to. The element includes the open/close image and the rendered value and spans the width of the tree.- Returns:
- the selection element
-
getValueKey
Returns the key for the value of this node using the parent's implementation of NodeInfo.getKey(). -
onOpen
Set up the node when it is opened.- Type Parameters:
C- the child data type of the node- Parameters:
nodeInfo- theTreeViewModel.NodeInfothat provides information about the child values
-
belongsToTree
-
ensureAnimationFrame
Element ensureAnimationFrame()Ensure that the animation frame exists and return it.- Returns:
- the animation frame
-
ensureChildContainer
Element ensureChildContainer()Ensure that the child container exists and return it.- Returns:
- the child container
-
ensureContentContainer
Element ensureContentContainer()Ensure that the content container exists and return it.- Returns:
- the content container
-
getIndex
int getIndex()Return the index of this node in its parent. -
getParentNode
CellTreeNodeView<?> getParentNode()Return the parent node, or null if this node is the root. -
getShowMoreElement
Element getShowMoreElement() -
getTreeNode
TreeNode getTreeNode()Get aTreeNodewith a public API for this node view.- Returns:
- the
TreeNode
-
indexOf
-
isDestroyed
boolean isDestroyed() -
isRootNode
boolean isRootNode()Check if this node is a root node.- Returns:
- true if a root node
-
isSelected
boolean isSelected()Check if the value of this node is selected.- Returns:
- true if selected, false if not
-
resetFocusOnCell
boolean resetFocusOnCell()Reset focus on this node.- Returns:
- true of the cell takes focus, false if not
-
setKeyboardSelected
void setKeyboardSelected(boolean selected, boolean stealFocus) Select or deselect this node with the keyboard.- Parameters:
selected- true if selected, false if notstealFocus- true to steal focus
-
setKeyboardSelectedStyle
void setKeyboardSelectedStyle(boolean selected) Add or remove the keyboard selected style.- Parameters:
selected- true if selected, false if not
-
setSelected
void setSelected(boolean selected) Select or deselect this node.- Parameters:
selected- true to select, false to deselect
-
showFewer
void showFewer() -
showMore
void showMore()
-