Class CellTreeNodeView.TreeNodeImpl
- java.lang.Object
-
- com.google.gwt.user.cellview.client.CellTreeNodeView.TreeNodeImpl
-
- All Implemented Interfaces:
TreeNode
- Enclosing class:
- CellTreeNodeView<T>
static class CellTreeNodeView.TreeNodeImpl extends java.lang.Object implements TreeNode
An implementation ofTreeNodethat delegates to aCellTreeNodeView. This class is intentionally static because we might move it to a newCellTreeNodeView, and we don't want non-static references to the oldCellTreeNodeView.
-
-
Constructor Summary
Constructors Constructor Description TreeNodeImpl(CellTreeNodeView<?> nodeView)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidflush()Flush pending changes in the view.intgetChildCount()Get the number of children of the node.java.lang.ObjectgetChildValue(int index)Get the value associated with a child node.intgetIndex()Get the index of the current node relative to its parent.(package private) CellTreeNodeView<?>getNodeView()TreeNodegetParent()Get the parent node of this node.java.lang.ObjectgetValue()Get the value associated with this node.booleanisChildLeaf(int index)Check whether or not a child node is a leaf node.booleanisChildOpen(int index)Check whether or not a child node is open.booleanisDestroyed()Check whether or not the current node is destroyed.TreeNodesetChildOpen(int index, boolean open)Open or close a child node and fire an event.TreeNodesetChildOpen(int index, boolean open, boolean fireEvents)Open or close the node, optionally firing an event.
-
-
-
Constructor Detail
-
TreeNodeImpl
public TreeNodeImpl(CellTreeNodeView<?> nodeView)
-
-
Method Detail
-
getChildCount
public int getChildCount()
Description copied from interface:TreeNodeGet the number of children of the node.- Specified by:
getChildCountin interfaceTreeNode- Returns:
- the child count
-
getChildValue
public java.lang.Object getChildValue(int index)
Description copied from interface:TreeNodeGet the value associated with a child node.- Specified by:
getChildValuein interfaceTreeNode- Parameters:
index- the child index- Returns:
- the value
-
getIndex
public int getIndex()
Description copied from interface:TreeNodeGet the index of the current node relative to its parent.
-
getNodeView
final CellTreeNodeView<?> getNodeView()
-
getParent
public TreeNode getParent()
Description copied from interface:TreeNodeGet the parent node of this node.
-
getValue
public java.lang.Object getValue()
Description copied from interface:TreeNodeGet the value associated with this node. This method can be called on destroyed nodes.
-
isChildLeaf
public boolean isChildLeaf(int index)
Description copied from interface:TreeNodeCheck whether or not a child node is a leaf node.- Specified by:
isChildLeafin interfaceTreeNode- Parameters:
index- the index of the child- Returns:
- true if a leaf node, false if not
-
isChildOpen
public boolean isChildOpen(int index)
Description copied from interface:TreeNodeCheck whether or not a child node is open.- Specified by:
isChildOpenin interfaceTreeNode- Parameters:
index- the index of the child- Returns:
- true if open, false if closed
-
isDestroyed
public boolean isDestroyed()
Description copied from interface:TreeNodeCheck whether or not the current node is destroyed. The node is destroyed when it is closed, even if it still appears in the tree as an unopened non-leaf node. Once a node is destroyed, calling most methods on the node results in anIllegalStateException.- Specified by:
isDestroyedin interfaceTreeNode- Returns:
- true if destroyed, false if active
-
setChildOpen
public TreeNode setChildOpen(int index, boolean open)
Description copied from interface:TreeNodeOpen or close a child node and fire an event. Ifopenis true and theTreeNodesuccessfully opens, returns the childTreeNode. Delegates toTreeNode.setChildOpen(int,boolean, boolean).- Specified by:
setChildOpenin interfaceTreeNode- Parameters:
index- the index of the childopen- true to open, false to close- Returns:
- the
TreeNodethat was opened, or null if the node was closed or could not be opened
-
setChildOpen
public TreeNode setChildOpen(int index, boolean open, boolean fireEvents)
Description copied from interface:TreeNodeOpen or close the node, optionally firing an event. Ifopenis true and theTreeNodesuccessfully opens, returns the childTreeNode.- Specified by:
setChildOpenin interfaceTreeNode- Parameters:
index- the index of the childopen- true to open, false to flosefireEvents- true to fire an event, false not to- Returns:
- the
TreeNodethat was opened, or null if the node was closed or could not be opened
-
flush
void flush()
Flush pending changes in the view.
-
-