com.google.gwt.user.cellview.client

## Interface TreeNode

All Known Implementing Classes:
  CellBrowser.TreeNodeImpl, CellTreeNodeView.TreeNodeImpl

    public interface TreeNode

A representation of a node in a tree.

### Method Summary

All Methods Instance Methods Abstract Methods
`int` `getChildCount()` Get the number of children of the node.
`java.lang.Object` `getChildValue(int index)` Get the value associated with a child node.
`int` `getIndex()` Get the index of the current node relative to its parent.
`TreeNode` `getParent()` Get the parent node of this node.
`java.lang.Object` `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` `isDestroyed()` Check whether or not the current node is destroyed.
`TreeNode` `setChildOpen(int index, boolean open)` Open or close a child node and fire an event.
`TreeNode` `setChildOpen(int index, boolean open, boolean fireEvents)` Open or close the node, optionally firing an event.

### Method Detail

#### getChildCount

    int getChildCount()

Get the number of children of the node.

Returns:
  the child count

#### getChildValue

    java.lang.Object getChildValue(int index)

Get the value associated with a child node.

Parameters:
  `index` - the child index
Returns:
  the value

#### getIndex

    int getIndex()

Get the index of the current node relative to its parent.

Returns:
  the index of the current node

#### getParent

    TreeNode getParent()

Get the parent node of this node.

Returns:
  the parent node, or null if this node is the root node

#### getValue

    java.lang.Object getValue()

Get the value associated with this node. This method can be called on destroyed nodes.

Returns:
  the value

#### isChildLeaf

    boolean isChildLeaf(int index)

Check whether or not a child node is a leaf node.

Parameters:
  `index` - the index of the child
Returns:
  true if a leaf node, false if not

#### isChildOpen

    boolean isChildOpen(int index)

Check whether or not a child node is open.

Parameters:
  `index` - the index of the child
Returns:
  true if open, false if closed

#### isDestroyed

    boolean isDestroyed()

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 an `IllegalStateException`.

Returns:
  true if destroyed, false if active

#### setChildOpen

    TreeNode setChildOpen(int index,
                          boolean open)

Open or close a child node and fire an event. If `open` is true and the `TreeNode` successfully opens, returns the child `TreeNode`. Delegates to `setChildOpen(int,boolean, boolean)`.

Parameters:
  `index` - the index of the child
  `open` - 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

    TreeNode setChildOpen(int index,
                          boolean open,
                          boolean fireEvents)

Open or close the node, optionally firing an event. If `open` is true and the `TreeNode` successfully opens, returns the child `TreeNode`.

Parameters:
  `index` - the index of the child
  `open` - true to open, false to flose
  `fireEvents` - 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