Methods Summary |
---|
public void | addChild(com.mycompany.jsf.model.TreeNode child)Adds the provided node as a child of this node.
if (children == null) {
children = new ArrayList();
}
child.setParent(this);
children.add(child);
|
public java.util.List | getChildren()Returns all children of this node.
if (children == null) {
children = new ArrayList();
}
return children;
|
public java.lang.String | getName()Returns the node name.
return name;
|
private com.mycompany.jsf.model.TreeNode | getParent()Returns the parent of this node.
return parent;
|
public java.lang.String | getPath()Returns a String representing the path to this node, with
the names of each parent node separated by a slash and ending
with the name of the current node.
List chain = new ArrayList();
chain.add(getName());
TreeNode parent = getParent();
while (parent != null) {
chain.add(parent.getName());
parent = parent.getParent();
}
StringBuffer sb = new StringBuffer();
for (int i = chain.size() - 1; i >= 0; i--) {
sb.append("/").append(chain.get(i));
}
return sb.toString();
|
public java.lang.Object | getValue()Returns the node value.
return value;
|
public boolean | isExpanded()Returns "true" if the node is expanded,
return isExpanded;
|
public boolean | isLeafNode()Returns "true" if this is a leaf node.
return isLeafNode;
|
public void | setExpanded(boolean isExpanded)Sets the "expanded" property value.
this.isExpanded = isExpanded;
|
public void | setLeafNode(boolean isLeafNode)Sets the "leafNode" property value.
this.isLeafNode = isLeafNode;
|
public void | setName(java.lang.String name)Sets the node name.
this.name = name;
|
private void | setParent(com.mycompany.jsf.model.TreeNode parent)Sets the parent of this node, called by the addChild() method.
this.parent = parent;
|
public void | setValue(java.lang.Object value)Sets the node value.
this.value = value;
|