## org.apache.myfaces.custom.tree2
Interface TreeModel

All Superinterfaces:
  java.io.Serializable

All Known Implementing Classes:
  TreeModelBase

public interface TreeModel
extends java.io.Serializable

Model class for the tree component. It provides random access to nodes in a tree made up of instances of the `TreeNode` class.

Version:
  $Revision: 231342 $ $Date: 2005-08-10 18:33:20 -0400 (Wed, 10 Aug 2005) $
Author:
  Sean Schofield

Field Summary
`static java.lang.String` `SEPARATOR` Separator char to be used in node path generation.

Method Summary
`TreeNode` `getNode()` Gets the current `TreeNode` or `null` if no node ID is selected.
`java.lang.String[]` `getPathInformation(java.lang.String nodeId)` Gets an array of String containing the ID's of all of the `TreeNode`s in the path to the specified node.
`TreeState` `getTreeState()`
`boolean` `isLastChild(java.lang.String nodeId)` Indicates whether or not the specified `TreeNode` is the last child in the `List` of children.
`void` `setNodeId(java.lang.String nodeId)` Sets the current `TreeNode` to the specified node ID.
`void` `setTreeState(TreeState state)`

Field Detail

### SEPARATOR

    public static final java.lang.String SEPARATOR

  Separator char to be used in node path generation.

Method Detail

### getNode

    public TreeNode getNode()

  Gets the current `TreeNode` or `null` if no node ID is selected.

  Returns:
    The current node

### setNodeId

    public void setNodeId(java.lang.String nodeId)

  Sets the current `TreeNode` to the specified node ID.

  Parameters:
    `nodeId` - The id of the node to set

### getPathInformation

    public java.lang.String[] getPathInformation(java.lang.String nodeId)

  Gets an array of String containing the ID's of all of the `TreeNode`s in the path to the specified node. The path information will be an array of `String` objects representing node ID's. The array will starting with the ID of the root node and end with the ID of the specified node.

  Parameters:
    `nodeId` - The id of the node for whom the path information is needed.
  Returns:
    String[]

### isLastChild

    public boolean isLastChild(java.lang.String nodeId)

  Indicates whether or not the specified `TreeNode` is the last child in the `List` of children. If the node id provided corresponds to the root node, this returns `true`.

  Parameters:
    `nodeId` - The ID of the node to check
  Returns:
    boolean

### setTreeState

    public void setTreeState(TreeState state)

### getTreeState

    public TreeState getTreeState()