org.apache.myfaces.custom.tree2
Class TreeWalkerBase

java.lang.Object
  extended by org.apache.myfaces.custom.tree2.TreeWalkerBase
All Implemented Interfaces:
TreeWalker

public class TreeWalkerBase
extends Object
implements TreeWalker

A base implementation of the TreeWalker interface. Uses a simple node naming scheme of "0" for the root node, "0:0" for the first child, "0:1" for the second child, etc.


Constructor Summary
TreeWalkerBase()
           
 
Method Summary
 String getRootNodeId()
          Returns the id of the root node.
 boolean isCheckState()
          Getter for the check state property.
 boolean next()
          Walk the tree and set the current node to the next node.
 void reset()
          Reset the walker so the tree can be walked again starting from the root.
 void setCheckState(boolean checkState)
          Setter for the check state property.
 void setTree(Tree tree)
          This method allows the renderer to pass a reference to the tree object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeWalkerBase

public TreeWalkerBase()
Method Detail

setTree

public void setTree(Tree tree)
Description copied from interface: TreeWalker
This method allows the renderer to pass a reference to the tree object. With this reference the TreeWalker can set the current node as its walking the tree.

Specified by:
setTree in interface TreeWalker
Parameters:
tree - Tree

isCheckState

public boolean isCheckState()
Description copied from interface: TreeWalker
Getter for the check state property. Indicates whether or not the TreeWalker should navigate over nodes that are not currently expanded.

Specified by:
isCheckState in interface TreeWalker
Returns:
boolean

setCheckState

public void setCheckState(boolean checkState)
Description copied from interface: TreeWalker
Setter for the check state property. Indicates whether or not the TreeWalker should navigate over nodes that are not currently expanded.

Specified by:
setCheckState in interface TreeWalker
Parameters:
checkState - boolean

next

public boolean next()
Description copied from interface: TreeWalker
Walk the tree and set the current node to the next node.

Specified by:
next in interface TreeWalker
Returns:
boolean whether or not there was another node to walk

getRootNodeId

public String getRootNodeId()
Description copied from interface: TreeWalker
Returns the id of the root node.

Specified by:
getRootNodeId in interface TreeWalker
Returns:
String

reset

public void reset()
Description copied from interface: TreeWalker
Reset the walker so the tree can be walked again starting from the root.

Specified by:
reset in interface TreeWalker


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.