com.filenet.wcm.toolkit.server.util.ui
Class WcmTreeNode

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.ui.WcmTreeNode

public class WcmTreeNode
extends java.lang.Object

This class is a base implementation of a tree node structure. Each tree node can have zero or more child nodes where each child node is also a tree node.


Field Summary
protected  WcmAnchor anchor
          The tree node anchor.
protected  java.util.List children
          The list of child nodes.
protected  boolean collapsed
          Indicates a collapsed tree node.
protected  java.lang.String id
          The id of the tree node.
protected  java.lang.Object userData
          Optional - page name
 
Constructor Summary
protected WcmTreeNode()
          Constructs a new tree node.
  WcmTreeNode(WcmAnchor a)
          Constructs a new tree node using a WcmAnchor object.
  WcmTreeNode(WcmAnchor a, java.lang.String nodeId)
          Constructs a new tree node using a WcmAnchor object and sets it ID to the specified node id.
 
Method Summary
 void addChild(java.lang.String label, java.lang.String url, java.lang.String id)
          Adds a new child node to the tree node using the passed in parameters.
 void addChild(WcmString localizedLabel, java.lang.String url, java.lang.String id)
          Adds a new child node to the tree node using the passed in parameters.
 void addChild(WcmTreeNode child)
          Adds a new child node to the tree node.
 void clearChildren()
          Removes all child nodes.
 WcmAnchor getAnchor()
          Returns the anchor of the tree node.
 java.util.List getChildren()
          Returns the list of all child nodes.
 java.lang.String getID()
          Returns the node id of the tree node.
protected  java.lang.String getRandomID()
          Generates and returns a random id.
 java.lang.Object getUserData()
          Returns user data set by setuserData() method
 boolean isCollapsed()
           
 void removeChild(int index)
          Removes a child node from the tree node by index.
 int removeChild(java.lang.String id)
           
 boolean setCollapsed(boolean newValue)
          Specify this node's collapsed flag.
 void setID(java.lang.String nodeId)
          Sets the node id of the tree node.
 void setUserData(java.lang.Object userData)
          Sets user data for a tree node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id
The id of the tree node.


anchor

protected WcmAnchor anchor
The tree node anchor. This is a WcmAnchor object.


children

protected java.util.List children
The list of child nodes.


collapsed

protected boolean collapsed
Indicates a collapsed tree node. Child nodes are not visible.


userData

protected java.lang.Object userData
Optional - page name

Constructor Detail

WcmTreeNode

protected WcmTreeNode()
Constructs a new tree node. This is the default constructor that has no implementation.


WcmTreeNode

public WcmTreeNode(WcmAnchor a)
Constructs a new tree node using a WcmAnchor object.

Parameters:
a - A WcmAnchor object.

WcmTreeNode

public WcmTreeNode(WcmAnchor a,
                   java.lang.String nodeId)
Constructs a new tree node using a WcmAnchor object and sets it ID to the specified node id.

Parameters:
a - A WcmAnchor object.
nodeId - The node id.
Method Detail

isCollapsed

public boolean isCollapsed()
Returns:
The node's collapsed flag value.

setCollapsed

public boolean setCollapsed(boolean newValue)
Specify this node's collapsed flag.

Parameters:
newValue -
Returns:
the previous value.

getID

public java.lang.String getID()
Returns the node id of the tree node. A random id will be returned if the tree node has no id.

Returns:
String The node id.

setID

public void setID(java.lang.String nodeId)
Sets the node id of the tree node.

Parameters:
nodeId - The node id.

getChildren

public java.util.List getChildren()
Returns the list of all child nodes.

Returns:
List A List of all child nodes.

getRandomID

protected java.lang.String getRandomID()
Generates and returns a random id.

Returns:
String A random id.

addChild

public void addChild(WcmTreeNode child)
Adds a new child node to the tree node.

Parameters:
child - A child node that is a WcmTreeNode object.

addChild

public void addChild(WcmString localizedLabel,
                     java.lang.String url,
                     java.lang.String id)
Adds a new child node to the tree node using the passed in parameters. A new child node is constructed with the given parameters and then added to the tree node.

Parameters:
localizedLabel - The label of the child node.
url - The url of the child node.
id - The id of the child node.

addChild

public void addChild(java.lang.String label,
                     java.lang.String url,
                     java.lang.String id)
Adds a new child node to the tree node using the passed in parameters. A new child node is constructed with the given parameters and then added to the tree node.

Parameters:
label - The label of the child node.
url - The url of the child node.
id - The id of the child node.

removeChild

public void removeChild(int index)
Removes a child node from the tree node by index.

Parameters:
index - The index of the child node.

removeChild

public int removeChild(java.lang.String id)

clearChildren

public void clearChildren()
Removes all child nodes.


getAnchor

public WcmAnchor getAnchor()
Returns the anchor of the tree node.

Returns:
WcmAnchor The WcmAnchor object of the tree node.

getUserData

public java.lang.Object getUserData()
Returns user data set by setuserData() method

Returns:
object

setUserData

public void setUserData(java.lang.Object userData)
Sets user data for a tree node

Parameters:
userData -


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.