|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTreeElement
public class TreeElement
An individual node of a Tree
, and rendered by that Tree instance.
Field Summary | |
---|---|
ArrayList |
_attribute
|
static String |
EXPAND_NODE
|
static String |
SELECTED_NODE
|
static String |
TREE_ANCHOR
Constant used to indicate an anchor is an expand/collapse tree node |
static String |
TREE_ANCHOR_ID
|
static String |
TREE_ANCHOR_INIT
|
static String |
TREE_COLLAPSE_IMAGE
|
static String |
TREE_COLLAPSE_STATE
|
static String |
TREE_EXPAND
|
static String |
TREE_EXPAND_IMAGE
|
static String |
TREE_EXPAND_PATH
|
static String |
TREE_EXPAND_STATE
|
static String |
TREE_EXPANDED
Constant used to indicate that a tree node anchor should be set expanded. |
static String |
TREE_ID
|
static String |
TREE_JAVASCRIPT_CLASS
|
static String |
TREE_LEVEL
|
static String |
TREE_NODE_LAST
|
Constructor Summary | |
---|---|
TreeElement()
Default constructor for creating a simple tree. |
|
TreeElement(String label,
boolean expanded)
Construct a new TreeElement with the specified parameters. |
Method Summary | |
---|---|
void |
addAttribute(TreeHtmlAttributeInfo attr)
This method is called by the children tags of the TreeItem. |
void |
addChild(int offset,
TreeElement child)
Add a new child node at the specified position in the child list. |
void |
addChild(TreeElement child)
Add a new child node to the end of the list. |
void |
addParameter(String name,
Object value,
String facet)
This method will allow a tag that produces one or more Urls to have parameters set on the tag. |
void |
clearChildren()
|
TreeElement |
findNode(String nodeName)
Given a node, find the named child. |
String |
getAction()
Gets the action invoked if this node is selected by the user. |
ArrayList |
getAttributeList()
Return the list of attributes. |
TreeElement |
getChild(int index)
Return the child node at the given zero-relative index. |
TreeElement[] |
getChildren()
Return the set of child nodes for this node. |
String |
getClientAction()
Gets the client action invoked if this node is selected by the user. |
String |
getContent()
Return the content. |
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. |
InheritableState |
getInheritableState()
|
String |
getLabel()
Gets the label that will be displayed when this node is visible. |
int |
getLevel()
|
String |
getName()
Returns the unique name of the node. |
HashMap |
getParams()
|
TreeElement |
getParent()
Gets the parent node of this node, or null if this
is the root node. |
static TreeElement |
getRoot(TreeElement node)
Gets the root node of this tree. |
String |
getScope()
Get the target scope for this node's URI. |
String |
getTagId()
Return the ID of the tag. |
String |
getTarget()
Gets the window target for the hyperlink identified by the action property, if this node is selected. |
String |
getTitle()
Set the title attribute for the node. |
boolean |
isDisabled()
Gets whether this node currently selected. |
boolean |
isExpanded()
Gets if this node is currently expanded. |
boolean |
isExpandOnServer()
This method will return the state of the expand on server attribute. |
boolean |
isLabelLegalAsAlt()
|
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. one with no children) |
boolean |
isSelected()
Gets whether this node currently selected. |
void |
onExpand(ServletRequest request,
ServletResponse response)
Code that runs when the node is expanded. |
void |
onSelect(ServletRequest request)
Code that runs when the node is 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(TreeElement child)
Remove the specified child node. |
void |
setAction(String action)
Set the action to be called when the node is selected. |
void |
setClientAction(String clientAction)
Set the client action to be called when the node is selected. |
void |
setContent(String content)
Set the content of the node. |
void |
setDisabled(boolean disabled)
Sets whether this node currently selected. |
void |
setExpanded(boolean expanded)
Sets if this node is currently expanded. |
void |
setExpandOnServer(boolean expandOnServer)
Set the value of the expandOnServer attribute. |
void |
setHref(String href)
Set the hyperlink which will be called when the node is selected. |
void |
setIcon(String icon)
Set the pathname to the icon to display when this node is visible. |
void |
setInheritableState(InheritableState state)
|
void |
setLabel(String label)
Set the text of the label associated with this node. |
protected void |
setName(String name)
Set the unique name of the node. |
protected void |
setParent(TreeElement parent)
Sets the parent node of this node. |
void |
setScope(String scope)
Set the target scope for this anchor's URI. |
void |
setSelected(boolean selected)
Sets whether this node currently selected. |
void |
setTagId(String tagId)
Set the ID of the tag. |
void |
setTarget(String target)
Set the window target for the hyperlink indentified by the action . |
void |
setTitle(String title)
Returns the current title attribute for the node. |
int |
size()
This method will return the number of children of the node. |
protected void |
updateName(TreeElement parentNode,
int index)
This method will update the name of this node and all of the children node. |
Methods inherited from class 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
public static final String TREE_ID
public static final String TREE_JAVASCRIPT_CLASS
public static final String TREE_ANCHOR
public static final String TREE_ANCHOR_INIT
public static final String TREE_ANCHOR_ID
public static final String TREE_EXPAND
public static final String TREE_EXPAND_PATH
public static final String TREE_NODE_LAST
public static final String TREE_EXPAND_STATE
public static final String TREE_COLLAPSE_STATE
public static final String TREE_LEVEL
public static final String TREE_EXPAND_IMAGE
public static final String TREE_COLLAPSE_IMAGE
public static final String TREE_EXPANDED
public ArrayList _attribute
Constructor Detail |
---|
public TreeElement()
public TreeElement(String label, boolean expanded)
expanded
- Should this node be expanded?Method Detail |
---|
public String getIcon()
public void setIcon(String icon)
icon
- The relative path to the icond.public String getLabel()
public void setLabel(String label)
label
- The text of the tree node.public boolean isLabelLegalAsAlt()
public String getContent()
public void setContent(String content)
content
- The text of the tree node.public String getAction()
public void setAction(String action)
action
or href
or clientAction
set but not both.
action
- an action in the page flow that will run when the node is selected.public String getClientAction()
public void setClientAction(String clientAction)
action
or href
or clientAction
set but not both.
clientAction
- an action in the page flow that will run when the node is selected.public String getTagId()
netui_names
table written
into the HTML.
public void setTagId(String tagId)
tagId
- the tagId.public String getHref()
public void setHref(String href)
action
or href
or clientAction
set but not both.
href
- The hyperlink called when the node is selected.public String getTarget()
action
property, if this node is selected.
public void setTarget(String target)
action
.
target
- the window target.public boolean isExpanded()
public void setExpanded(boolean expanded)
expanded
- the expanded statepublic boolean isExpandOnServer()
public void setExpandOnServer(boolean expandOnServer)
true
and runAtClient
is also true, then an expansion on this node will cause that
to happen on the server. When runAtClient is false, all expansions will happen on the server.
expandOnServer
- boolean value indicating if the node should be expanded on the server.public String getScope()
setScope(java.lang.String)
public void setScope(String scope)
target
attribute to invoke a new page flow in a separate window.
scope
- a String that identifies the scope in which the target page flow will be made active.public String getTitle()
public void setTitle(String title)
title
- public InheritableState getInheritableState()
public void setInheritableState(InheritableState state)
public void addParameter(String name, Object value, String facet)
IUrlParams
addParameter
in interface IUrlParams
name
- The name of the parameter to be added to the URL.value
- The value of the parameter.facet
- The name of a facet for which the parameter should be added.public HashMap getParams()
public boolean isLast()
public int getLevel()
public boolean isLeaf()
public String getName()
public TreeElement getParent()
null
if this
is the root node.
public boolean isSelected()
public void setSelected(boolean selected)
selected
- the selected statepublic boolean isDisabled()
public void setDisabled(boolean disabled)
disabled
- the selected statepublic void addAttribute(TreeHtmlAttributeInfo attr)
TreeHtmlAttribute
it will set the attribute name and value.
attr
- public ArrayList getAttributeList()
protected void setName(String name)
name
- the name of the node.protected void setParent(TreeElement parent)
parent
- the TreeElement parentpublic void onExpand(ServletRequest request, ServletResponse response)
public void onSelect(ServletRequest request)
public void addChild(TreeElement child) throws IllegalArgumentException
child
- The new child node
IllegalArgumentException
- if the name of the new child
node is not uniquepublic int size()
public void addChild(int offset, TreeElement 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 void clearChildren()
public TreeElement[] getChildren()
public TreeElement getChild(int index)
index
- The child node index
public void removeChild(int offset)
offset
- Zero-relative offset at which the existing
node should be removedpublic void removeChild(TreeElement child)
child
- Child node to be removedprotected void updateName(TreeElement parentNode, int index)
parentNode
- The parent node of this node.index
- the index position of this node within the parent node.public static TreeElement getRoot(TreeElement node)
node
- The TreeElement to start from
public TreeElement findNode(String nodeName)
nodeName
- the name of the child to find.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |