com.sri.common.taglib
Interface TreeNode

All Known Implementing Classes:
DefaultTreeNode

public interface TreeNode

Composite Tree Node interface. Allows for iterating children (if any) and all information needed to render the tree node.

Author:
Michael Rimov

Field Summary
static TreeNode[] NO_CHILDREN
          If there are no children then getNested() returns NO_CHILDREN which is a Special Case of no children nodes.
 
Method Summary
 void collapseAllFolders()
          Collapses all folders by marking the root node as unselected.
 void expandAllFolders()
          Expands all folder nodes by marking them selected without marking any leaf nodes necessarily selected.
 String getIconUrl()
          Retrieve url of the icon associated with the node.
 String getLabel()
          Retrieve the Label of the tree node.
 String getLink()
          Retrieve the link if the node is clicked.
 TreeNode[] getNested()
          Retrieve all children (may be an empty array) if no children.
 String getSelectedStyle()
          Retrieve the CSS style for the node when it is selected.
 String getUnselectedStyle()
          Retrieve the CSS style for the node when it is unselected.
 boolean isSelected()
          Returns true if this node is selected.
 void setSelected(boolean selectionValue)
          Manipulator that sets the selected value to true.
 

Field Detail

NO_CHILDREN

static final TreeNode[] NO_CHILDREN
If there are no children then getNested() returns NO_CHILDREN which is a Special Case of no children nodes.

Method Detail

getLabel

String getLabel()
Retrieve the Label of the tree node.

Returns:
String the label

getLink

String getLink()
Retrieve the link if the node is clicked.

Returns:
String url for the link of the node.

getSelectedStyle

String getSelectedStyle()
Retrieve the CSS style for the node when it is selected. (Or for folders, when its children are selected or it is open)

Returns:
String

getUnselectedStyle

String getUnselectedStyle()
Retrieve the CSS style for the node when it is unselected. (Or for folders, when it is closed)

Returns:
String

getNested

TreeNode[] getNested()
Retrieve all children (may be an empty array) if no children.

Returns:
TreeNode[] or TreeNode.NO_CHILDREN if there are none.

getIconUrl

String getIconUrl()
Retrieve url of the icon associated with the node. This is optional, and if it is set, the image tag will be set inside the <a> tag.

Returns:
String

isSelected

boolean isSelected()
Returns true if this node is selected. If it is a folder node, then it should normally appear open as well.

Returns:
true if it or its children are selected.

setSelected

void setSelected(boolean selectionValue)
Manipulator that sets the selected value to true. Expected behavior is that when something is selected, all parents are selected. If something is de-selected, then all parents are de-selected.

Parameters:
selectionValue - true if the value should be selected.

expandAllFolders

void expandAllFolders()
Expands all folder nodes by marking them selected without marking any leaf nodes necessarily selected.


collapseAllFolders

void collapseAllFolders()
Collapses all folders by marking the root node as unselected.



Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.