org.apache.beehive.netui.tags.tree
Class TreeItem

Object
  extended by SimpleTagSupport
      extended by AbstractSimpleTag
          extended by TreeItem
All Implemented Interfaces:
JspTag, SimpleTag, IUrlParams, INetuiTag

public class TreeItem
extends AbstractSimpleTag
implements IUrlParams

Instantiates a TreeElement object that will get added to the parent tag (either a Tree or another TreeItem).

See Also:
Tree, TreeElement
Example
In this first sample, a TreeItem contained by a parent TreeItem or Tree will display with the label of "Login" and, when clicked, will navigate to the Login pageflow.
<netui:treeItem label="Login" action="/netui/login/Login.jpf" />

In this next sample, a TreeItem contained by a parent TreeItem or Tree will display with the label of "Human Resources" and icon "folder16.gif" and most likely will have child TreeItem tags because it does not have an action and starts expanded.

<netui:treeItem label="Human Resources" icon="folder16.gif" expanded="true">

Constructor Summary
TreeItem()
           
 
Method Summary
 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 doTag()
          Instantiate a new TreeElement.
 TreeElement getNode()
           
 String getTagName()
          Return the name of the Tag.
 void setAction(String action)
          Set the TreeItem's action.
 void setAddedChild()
           
 void setClientAction(String action)
          Sets an action to run on the client when the tree is selected.
 void setDisabled(boolean disabled)
          Disables the TreeItem.
 void setExpanded(boolean expanded)
          Sets the TreeItem expansion state.
 void setExpandOnServer(boolean expandOnServer)
          Set the value of the expandOnServer attribute.
 void setHref(String href)
          Sets the TreeItem's href.
 void setIcon(String icon)
          Sets the TreeItem icon URI.
 void setItemAttribute(TreeHtmlAttributeInfo attr)
          This method is called by the children tags of the TreeItem.
 void setItemContent(String content)
           
 void setItemInheritableState(InheritableState state)
           
 void setItemLabel(String label)
          This method is called by children tags of the TreeItem.
 void setScope(String scope)
          Set the target scope for this tree node's URI.
 void setTagId(String tagId)
          Set the ID of the tag.
 void setTarget(String target)
          Sets the window target.
 void setTitle(String title)
          Sets the TreeItems title.
 
Methods inherited from class AbstractSimpleTag
getBufferBody, getHtmlTag, getIdForTagId, getInlineError, getPageContext, getScriptReporter, getUserLocale, hasErrors, registerTagError, registerTagError, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeItem

public TreeItem()
Method Detail

getTagName

public String getTagName()
Return the name of the Tag.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractSimpleTag
Returns:
the name of the tag.

setAction

public void setAction(String action)
               throws JspException
Set the TreeItem's action.

Parameters:
action - - the action.
Throws:
JspException

setClientAction

public void setClientAction(String action)
                     throws JspException
Sets an action to run on the client when the tree is selected.

Parameters:
action - - the client action.
Throws:
JspException

setTagId

public void setTagId(String tagId)
              throws JspException
Set the ID of the tag.

Parameters:
tagId - - the tagId.
Throws:
JspException

setExpanded

public void setExpanded(boolean expanded)
Sets the TreeItem expansion state.

Parameters:
expanded - - the expanded state.

setDisabled

public void setDisabled(boolean disabled)
Disables the TreeItem.

Parameters:
disabled - - the enabled/disabled state.

setExpandOnServer

public void setExpandOnServer(boolean expandOnServer)
Set the value of the expandOnServer attribute. If the attribute is 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.

Parameters:
expandOnServer - boolean value indicating if the node should be expanded on the server.

setHref

public void setHref(String href)
             throws JspException
Sets the TreeItem's href.

Parameters:
href - - the href
Throws:
JspException

setTitle

public void setTitle(String title)
Sets the TreeItems title.

Parameters:
title -

setScope

public void setScope(String scope)
Set the target scope for this tree node's URI. Any page flow that handles the URI will be made active within the given scope. Scopes allow multiple page flows to be active within the same user session; page flows in different scopes do not in general interact with each other. This attribute is commonly used in conjunction with the target attribute (setTarget(java.lang.String)) to invoke a new page flow in a separate window.

Parameters:
scope - a String that identifies the scope in which the target page flow will be made active.

setIcon

public void setIcon(String icon)
Sets the TreeItem icon URI.

Parameters:
icon - - the icon URI

setItemLabel

public void setItemLabel(String label)
This method is called by children tags of the TreeItem. If there is a TreeLabel it will set the text of the label. A child TreeLabel will override the label attribute.

Parameters:
label - The text of the Label to be displayed for this TreeItem.

setItemContent

public void setItemContent(String content)
Parameters:
content -

setItemAttribute

public void setItemAttribute(TreeHtmlAttributeInfo attr)
This method is called by the children tags of the TreeItem. If there is a TreeHtmlAttribute it will set the attribute name and value.

Parameters:
attr -

setItemInheritableState

public void setItemInheritableState(InheritableState state)

setAddedChild

public void setAddedChild()

getNode

public TreeElement getNode()
Returns:
TreeElement

setTarget

public void setTarget(String target)
Sets the window target.

Parameters:
target - - the window target.

addParameter

public void addParameter(String name,
                         Object value,
                         String facet)
                  throws JspException
Description copied from interface: IUrlParams
This method will allow a tag that produces one or more Urls to have parameters set on the tag. The name and value should be required. The facet is optional, and allows tags producing more than one URL to have parameters set on different URLs.

Specified by:
addParameter in interface IUrlParams
Parameters:
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.
Throws:
JspException

doTag

public void doTag()
           throws JspException,
                  IOException
Instantiate a new TreeElement.

Specified by:
doTag in interface SimpleTag
Overrides:
doTag in class SimpleTagSupport
Throws:
JspException - if a JSP exception has occurred
IOException