org.apache.webapp.admin
Class TreeControlNode

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

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

An individual node of a tree control represented by an instance of TreeControl, and rendered by an instance of TreeControlTag.

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.lang.String action
          The hyperlink to which control will be directed if this node is selected by the user.
protected  java.util.ArrayList children
          The set of child TreeControlNodes for this node, in the order that they should be displayed.
protected  java.lang.String CSSClass
           
protected  java.lang.String domain
          The domain of this node.
protected  boolean expanded
          Is this node currently expanded?
protected  boolean expandWhenClicked
           
protected  java.lang.String icon
          The pathname to the icon file displayed when this node is visible, relative to the image directory for our images.
protected  java.lang.String label
          The label that will be displayed when this node is visible.
protected  boolean last
          Is this the last node in the set of children for our parent node?
protected  boolean lazy
           
protected  boolean leaf
          Is this a "leaf" node (i.e.
protected  boolean loaded
           
protected  java.lang.String name
          The unique (within the entire tree) name of this node.
protected  TreeControlNode parent
          The parent node of this node, or null if this is the root node.
protected  boolean selected
          Is this node currently selected?
protected  java.lang.String target
          The window target for the hyperlink identified by the action property, if this node is selected by the user.
protected  java.lang.String title
          The label that will be displayed when this node is visible.
protected  TreeControl tree
          The TreeControl instance representing the entire tree.
protected  int width
          The display width necessary to display this item (if it is visible).
 
Constructor Summary
TreeControlNode(java.lang.String name, java.lang.String icon, java.lang.String label, java.lang.String action, java.lang.String target, boolean expanded, java.lang.String domain)
          Construct a new TreeControlNode with the specified parameters.
TreeControlNode(java.lang.String name, java.lang.String icon, java.lang.String label, java.lang.String action, java.lang.String target, boolean expanded, java.lang.String domain, java.lang.String CSSClass)
          Construct a new TreeControlNode with the specified parameters.
TreeControlNode(java.lang.String name, java.lang.String icon, java.lang.String label, java.lang.String action, java.lang.String target, boolean expanded, java.lang.String domain, java.lang.String CSSClass, boolean lazy)
          Construct a new TreeControlNode with the specified parameters.
 
Method Summary
 void addChild(int offset, TreeControlNode child)
          Add a new child node at the specified position in the child list.
 void addChild(TreeControlNode child)
          Add a new child node to the end of the list.
 TreeControlNode[] findChildren()
          Return the set of child nodes for this node.
 java.lang.String getAction()
           
 java.lang.String getCSSClass()
           
 java.lang.String getDomain()
           
 java.lang.String getIcon()
           
 java.lang.String getLabel()
           
 java.lang.String getName()
           
 TreeControlNode getParent()
           
 java.lang.String getTarget()
           
 java.lang.String getTitle()
           
 TreeControl getTree()
           
 int getWidth()
           
 boolean isExpanded()
           
 boolean isExpandWhenClicked()
           
 boolean isLast()
           
 boolean isLazy()
           
 boolean isLeaf()
           
 boolean isLoaded()
           
 boolean isSelected()
           
 void remove()
          Remove this node from the tree.
 void removeChild(int offset)
          Remove the child node (and all children of that child) at the specified position in the child list.
 void setCSSClass(java.lang.String CSSClass)
           
 void setExpanded(boolean expanded)
           
 void setExpandWhenClicked(boolean expandWhenClicked)
           
 void setLabel(java.lang.String label)
           
 void setLeaf(boolean leaf)
           
 void setLoaded(boolean loaded)
           
 void setSelected(boolean selected)
           
 void setTitle(java.lang.String title)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected java.util.ArrayList children
The set of child TreeControlNodes for this node, in the order that they should be displayed.


action

protected java.lang.String action
The hyperlink to which control will be directed if this node is selected by the user.


domain

protected java.lang.String domain
The domain of this node.


expanded

protected boolean expanded
Is this node currently expanded?


icon

protected java.lang.String icon
The pathname to the icon file displayed when this node is visible, relative to the image directory for our images.


label

protected java.lang.String label
The label that will be displayed when this node is visible.


title

protected java.lang.String title
The label that will be displayed when this node is visible.


last

protected boolean last
Is this the last node in the set of children for our parent node?


lazy

protected boolean lazy

leaf

protected boolean leaf
Is this a "leaf" node (i.e. one with no children)?


loaded

protected boolean loaded

name

protected java.lang.String name
The unique (within the entire tree) name of this node.


parent

protected TreeControlNode parent
The parent node of this node, or null if this is the root node.


selected

protected boolean selected
Is this node currently selected?


target

protected java.lang.String target
The window target for the hyperlink identified by the action property, if this node is selected by the user.


tree

protected TreeControl tree
The TreeControl instance representing the entire tree.


width

protected int width
The display width necessary to display this item (if it is visible). If this item is not visible, the calculated width will be that of our most immediately visible parent.


CSSClass

protected java.lang.String CSSClass

expandWhenClicked

protected boolean expandWhenClicked
Constructor Detail

TreeControlNode

public TreeControlNode(java.lang.String name,
                       java.lang.String icon,
                       java.lang.String label,
                       java.lang.String action,
                       java.lang.String target,
                       boolean expanded,
                       java.lang.String domain)
Construct a new TreeControlNode with the specified parameters.

Parameters:
name - Internal name of this node (must be unique within the entire tree)
icon - Pathname of the image file for the icon to be displayed when this node is visible, relative to the image directory for our images
label - The label that will be displayed to the user if this node is visible
action - The hyperlink to be selected if the user selects this node, or null if this node's label should not be a hyperlink
target - The window target in which the action hyperlink's results will be displayed, or null for the current window
expanded - Should this node be expanded?
domain - Identifier for the kind of node.

TreeControlNode

public TreeControlNode(java.lang.String name,
                       java.lang.String icon,
                       java.lang.String label,
                       java.lang.String action,
                       java.lang.String target,
                       boolean expanded,
                       java.lang.String domain,
                       java.lang.String CSSClass)
Construct a new TreeControlNode with the specified parameters.

Parameters:
name - Internal name of this node (must be unique within the entire tree)
icon - Pathname of the image file for the icon to be displayed when this node is visible, relative to the image directory for our images
label - The label that will be displayed to the user if this node is visible
action - The hyperlink to be selected if the user selects this node, or null if this node's label should not be a hyperlink
target - The window target in which the action hyperlink's results will be displayed, or null for the current window
expanded - Should this node be expanded?
domain - Identifier for the kind of node.
CSSClass - The css class to apply to the node

TreeControlNode

public TreeControlNode(java.lang.String name,
                       java.lang.String icon,
                       java.lang.String label,
                       java.lang.String action,
                       java.lang.String target,
                       boolean expanded,
                       java.lang.String domain,
                       java.lang.String CSSClass,
                       boolean lazy)
Construct a new TreeControlNode with the specified parameters.

Parameters:
name - Internal name of this node (must be unique within the entire tree)
icon - Pathname of the image file for the icon to be displayed when this node is visible, relative to the image directory for our images
label - The label that will be displayed to the user if this node is visible
action - The hyperlink to be selected if the user selects this node, or null if this node's label should not be a hyperlink
target - The window target in which the action hyperlink's results will be displayed, or null for the current window
expanded - Should this node be expanded?
domain - Identifier for the kind of node.
CSSClass - The css class to apply to the node
lazy - Is this node's children lazy loaded?
Method Detail

getAction

public java.lang.String getAction()

getDomain

public java.lang.String getDomain()

isExpanded

public boolean isExpanded()

setExpanded

public void setExpanded(boolean expanded)

getIcon

public java.lang.String getIcon()

getLabel

public java.lang.String getLabel()

getTitle

public java.lang.String getTitle()

setTitle

public void setTitle(java.lang.String title)

setLabel

public void setLabel(java.lang.String label)

isLast

public boolean isLast()

isLazy

public boolean isLazy()

isLeaf

public boolean isLeaf()

setLeaf

public void setLeaf(boolean leaf)

isLoaded

public boolean isLoaded()

setLoaded

public void setLoaded(boolean loaded)

getName

public java.lang.String getName()

getParent

public TreeControlNode getParent()

isSelected

public boolean isSelected()

setSelected

public void setSelected(boolean selected)

getTarget

public java.lang.String getTarget()

getTree

public TreeControl getTree()

getWidth

public int getWidth()

getCSSClass

public java.lang.String getCSSClass()
Returns:
Returns the cSSClass.

setCSSClass

public void setCSSClass(java.lang.String CSSClass)
Parameters:
class1 - The cSSClass to set.

isExpandWhenClicked

public boolean isExpandWhenClicked()

setExpandWhenClicked

public void setExpandWhenClicked(boolean expandWhenClicked)

addChild

public void addChild(TreeControlNode child)
              throws java.lang.IllegalArgumentException
Add a new child node to the end of the list.

Parameters:
child - The new child node
Throws:
java.lang.IllegalArgumentException - if the name of the new child node is not unique

addChild

public void addChild(int offset,
                     TreeControlNode child)
              throws java.lang.IllegalArgumentException
Add a new child node at the specified position in the child list.

Parameters:
offset - Zero-relative offset at which the new node should be inserted
child - The new child node
Throws:
java.lang.IllegalArgumentException - if the name of the new child node is not unique

findChildren

public TreeControlNode[] findChildren()
Return the set of child nodes for this node.


remove

public void remove()
Remove this node from the tree.


removeChild

public void removeChild(int offset)
Remove the child node (and all children of that child) at the specified position in the child list.

Parameters:
offset - Zero-relative offset at which the existing node should be removed


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