Class CellBrowser.TreeNodeImpl<C>
java.lang.Object
com.google.gwt.user.cellview.client.CellBrowser.TreeNodeImpl<C>
- Type Parameters:
C
- the data type of the children of the node
- All Implemented Interfaces:
TreeNode
- Enclosing class:
CellBrowser
A node in the tree.
-
Constructor Summary
ConstructorDescriptionTreeNodeImpl
(TreeViewModel.NodeInfo<C> nodeInfo, Object value, CellBrowser.BrowserCellList<C> display, Widget widget) Construct a newCellBrowser.TreeNodeImpl
. -
Method Summary
Modifier and TypeMethodDescriptionint
Get the number of children of the node.getChildValue
(int index) Get the value associated with a child node.(package private) CellBrowser.BrowserCellList
<C> (package private) Object
Return the key of the value that is focused in this node's display.int
getIndex()
Get the index of the current node relative to its parent.Get the parent node of this node.getValue()
Get the value associated with this node.boolean
isChildLeaf
(int index) Check whether or not a child node is a leaf node.boolean
isChildOpen
(int index) Check whether or not a child node is open.boolean
Check whether or not the current node is destroyed.(package private) boolean
Return true if the focused value is open, false if not.setChildOpen
(int index, boolean open) Open or close a child node and fire an event.setChildOpen
(int index, boolean open, boolean fireEvents) Open or close the node, optionally firing an event.
-
Constructor Details
-
TreeNodeImpl
public TreeNodeImpl(TreeViewModel.NodeInfo<C> nodeInfo, Object value, CellBrowser.BrowserCellList<C> display, Widget widget) Construct a newCellBrowser.TreeNodeImpl
.- Parameters:
nodeInfo
- the nodeInfo for the children nodesvalue
- the value of the nodedisplay
- the display associated with the nodewidget
- the widget that wraps the display
-
-
Method Details
-
getChildCount
public int getChildCount()Description copied from interface:TreeNode
Get the number of children of the node.- Specified by:
getChildCount
in interfaceTreeNode
- Returns:
- the child count
-
getChildValue
Description copied from interface:TreeNode
Get the value associated with a child node.- Specified by:
getChildValue
in interfaceTreeNode
- Parameters:
index
- the child index- Returns:
- the value
-
getIndex
public int getIndex()Description copied from interface:TreeNode
Get the index of the current node relative to its parent. -
getParent
Description copied from interface:TreeNode
Get the parent node of this node. -
getValue
Description copied from interface:TreeNode
Get the value associated with this node. This method can be called on destroyed nodes. -
isChildLeaf
public boolean isChildLeaf(int index) Description copied from interface:TreeNode
Check whether or not a child node is a leaf node.- Specified by:
isChildLeaf
in 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:TreeNode
Check whether or not a child node is open.- Specified by:
isChildOpen
in interfaceTreeNode
- Parameters:
index
- the index of the child- Returns:
- true if open, false if closed
-
isDestroyed
public boolean isDestroyed()Description copied from interface:TreeNode
Check 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:
isDestroyed
in interfaceTreeNode
- Returns:
- true if destroyed, false if active
-
setChildOpen
Description copied from interface:TreeNode
Open or close a child node and fire an event. Ifopen
is true and theTreeNode
successfully opens, returns the childTreeNode
. Delegates toTreeNode.setChildOpen(int,boolean, boolean)
.- Specified by:
setChildOpen
in interfaceTreeNode
- Parameters:
index
- the index of the childopen
- true to open, false to close- Returns:
- the
TreeNode
that was opened, or null if the node was closed or could not be opened
-
setChildOpen
Description copied from interface:TreeNode
Open or close the node, optionally firing an event. Ifopen
is true and theTreeNode
successfully opens, returns the childTreeNode
.- Specified by:
setChildOpen
in interfaceTreeNode
- Parameters:
index
- the index of the childopen
- true to open, false to flosefireEvents
- true to fire an event, false not to- Returns:
- the
TreeNode
that was opened, or null if the node was closed or could not be opened
-
getDisplay
CellBrowser.BrowserCellList<C> getDisplay() -
getFocusedKey
Object getFocusedKey()Return the key of the value that is focused in this node's display. -
isFocusedOpen
boolean isFocusedOpen()Return true if the focused value is open, false if not.
-