|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bea.wlw.netui.tags.html.TreeNode
public class TreeNode
An individual node of a Tree
, and rendered by that Tree instance.
Field Summary | |
---|---|
protected String |
action
The action invoked if this node is selected by the user. |
protected ArrayList |
children
The set of child TreeControlNodes for this node, in the
order that they should be displayed. |
static String |
EXPAND_NODE
|
protected boolean |
expanded
Is this node currently expanded? |
protected String |
href
|
protected String |
icon
The pathname to the icon file displayed when this node is visible, relative to the image directory for our images. |
protected 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 String |
name
The unique (within the entire tree) name of this node. |
protected TreeNode |
parent
The parent node of this node, or null if this
is the root node. |
protected boolean |
selected
Is this node currently selected? |
static String |
SELECTED_NODE
|
protected String |
target
The window target for the hyperlink identified by the action property, if this node is selected
by the user. |
protected int |
width
The display width necessary to display this item (if it is visible). |
Constructor Summary | |
---|---|
TreeNode(String icon,
String label,
String action,
String href,
String target,
boolean expanded)
Construct a new TreeNode with the specified parameters. |
Method Summary | |
---|---|
void |
addChild(int offset,
TreeNode child)
Add a new child node at the specified position in the child list. |
void |
addChild(TreeNode child)
Add a new child node to the end of the list. |
void |
collapse()
Code that runs when the node is collapsed. |
void |
expand()
Code that runs when the node is expanded. |
TreeNode |
findNode(String nodeName)
|
String |
getAction()
Gets the action invoked if this node is selected by the user. |
TreeNode |
getChild(int index)
Return the child node at the given zero-relative index. |
TreeNode[] |
getChildren()
Return the set of child nodes for this node. |
String |
getHref()
Gets the hyperlink to which control will be directed if this node is selected by the user. |
String |
getIcon()
Gets the pathname to the icon file displayed when this node is visible, relative to the image directory for the images. |
String |
getLabel()
Gets the label that will be displayed when this node is visible. |
String |
getName()
|
TreeNode |
getParent()
Gets the parent node of this node, or null if this
is the root node. |
TreeNode |
getRoot(TreeNode node)
Gets the root node of this tree. |
String |
getTarget()
Gets the window target for the hyperlink identified by the action property, if this node is selected. |
int |
getWidth()
Gets the display width necessary to display this item (if it is visible). |
boolean |
isExpanded()
Gets if this node is currently expanded. |
boolean |
isLast()
Gets whether or not this is the last node in the set of children for the parent node. |
boolean |
isLeaf()
Gets whether or not this a "leaf" node (i.e. |
boolean |
isSelected()
Gets whether this node currently selected. |
void |
removeChild(int offset)
Remove the child node (and all children of that child) at the specified position in the child list. |
void |
removeChild(TreeNode child)
Remove the specified child node. |
void |
setExpanded(boolean expanded)
Sets if this node is currently expanded. |
void |
setIcon(String icon)
Set the pathname to the icon to display when this node is visible. |
void |
setLast(boolean last)
|
void |
setName(String name)
|
void |
setParent(TreeNode parent)
Sets the parent node of this node. |
void |
setSelected(boolean selected)
Sets whether this node currently selected. |
void |
updateName(TreeNode parentNode,
int index)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SELECTED_NODE
public static final String EXPAND_NODE
protected ArrayList children
TreeControlNodes
for this node, in the
order that they should be displayed.
protected String action
protected boolean expanded
protected String href
protected String icon
protected String label
protected boolean last
protected String name
protected TreeNode parent
null
if this
is the root node.
protected boolean selected
protected String target
action
property, if this node is selected
by the user.
protected int width
Constructor Detail |
---|
public TreeNode(String icon, String label, String action, String href, String target, boolean expanded)
icon
- Pathname of the image file for the icon to be displayed
when this node is visible, relative to the image directory
for our imageslabel
- The label that will be displayed to the user if
this node is visibleaction
- The action performed if the user
selects this node, or null
if this node's label should
not invoke an actionhref
- The hyperlink to be selected if the user
selects this node, or null
if this node's label should
not be a hyperlinktarget
- The window target in which the action
hyperlink's results will be displayed, or null
for
the current windowexpanded
- Should this node be expanded?Method Detail |
---|
public String getAction()
public boolean isExpanded()
public void setExpanded(boolean expanded)
expanded
- - the expanded statepublic String getHref()
public String getIcon()
public void setIcon(String icon)
icon
- The relative path to the icond.public String getLabel()
public boolean isLast()
public void setLast(boolean last)
public boolean isLeaf()
public String getName()
public void setName(String name)
public TreeNode getParent()
null
if this
is the root node.
public void setParent(TreeNode parent)
parent
- - the TreeNode parentpublic boolean isSelected()
public void setSelected(boolean selected)
selected
- - the selected statepublic String getTarget()
action
property, if this node is selected.
public int getWidth()
public void addChild(TreeNode child) throws IllegalArgumentException
child
- The new child node
IllegalArgumentException
- if the name of the new child
node is not uniquepublic void addChild(int offset, TreeNode child) throws IllegalArgumentException
offset
- Zero-relative offset at which the new node
should be insertedchild
- The new child node
IllegalArgumentException
- if the name of the new child
node is not uniquepublic TreeNode[] getChildren()
public TreeNode getChild(int index)
child
- The child node index
public void removeChild(int offset)
offset
- Zero-relative offset at which the existing
node should be removedpublic void removeChild(TreeNode child)
child
- Child node to be removedpublic void updateName(TreeNode parentNode, int index)
public void collapse()
public void expand()
public TreeNode getRoot(TreeNode node)
node
- The TreeNode to start from
public TreeNode findNode(String nodeName)
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |