org.apache.webapp.admin
Class TreeControl

java.lang.Object
  extended by org.apache.webapp.admin.TreeControl
All Implemented Interfaces:
java.io.Serializable

public class TreeControl
extends java.lang.Object
implements java.io.Serializable

The overall data structure representing a tree control that can be rendered by the TreeControlTag custom tag. Each node of the tree is represented by an instance of TreeControlNode.

Version:
$Revision: 516448 $ $Date: 2007-03-09 17:25:47 +0100 (Fri, 09 Mar 2007) $
Author:
Jazmin Jonson, Craig R. McClanahan
See Also:
Serialized Form

Field Summary
protected  java.util.HashMap registry
          The collection of nodes that represent this tree, keyed by name.
protected  TreeControlNode root
          The root node of the entire tree.
protected  TreeControlNode selected
          The most recently selected node.
 
Constructor Summary
TreeControl()
          Construct a new instance with no predefined root node.
TreeControl(TreeControlNode root)
          Construct a new instance with the specified root node.
 
Method Summary
 TreeControlNode findNode(java.lang.String name)
          Find and return the TreeControlNode for the specified node name, if it exists; otherwise, return null.
 TreeControlNode getRoot()
           
 int getWidth()
          The current displayable "width" of this tree (that is, the maximum depth of the visible part of the tree).
 void removeNode(TreeControlNode node)
          Deregister the specified node, as well as all child nodes of this node, from our registry of the complete tree.
 void selectNode(java.lang.String name)
          Mark the specified node as the one-and-only currently selected one, deselecting any previous node that was so marked.
protected  void setRoot(TreeControlNode root)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

registry

protected java.util.HashMap registry
The collection of nodes that represent this tree, keyed by name.


selected

protected TreeControlNode selected
The most recently selected node.


root

protected TreeControlNode root
The root node of the entire tree.

Constructor Detail

TreeControl

public TreeControl()
Construct a new instance with no predefined root node.


TreeControl

public TreeControl(TreeControlNode root)
Construct a new instance with the specified root node.

Parameters:
root - The new root node
Method Detail

getRoot

public TreeControlNode getRoot()

setRoot

protected void setRoot(TreeControlNode root)

getWidth

public int getWidth()
The current displayable "width" of this tree (that is, the maximum depth of the visible part of the tree).


findNode

public TreeControlNode findNode(java.lang.String name)
Find and return the TreeControlNode for the specified node name, if it exists; otherwise, return null.

Parameters:
name - Name of the TreeControlNode to be returned

selectNode

public void selectNode(java.lang.String name)
Mark the specified node as the one-and-only currently selected one, deselecting any previous node that was so marked.

Parameters:
node - Name of the node to mark as selected, or null if there should be no currently selected node

removeNode

public void removeNode(TreeControlNode node)
Deregister the specified node, as well as all child nodes of this node, from our registry of the complete tree. If this node is not present, no action is taken.

Parameters:
node - The TreeControlNode to be deregistered


Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.