org.apache.myfaces.custom.tree2
Class AbstractHtmlTree

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.apache.myfaces.custom.tree2.UITreeData
              extended by org.apache.myfaces.custom.tree2.AbstractHtmlTree
All Implemented Interfaces:
EventListener, javax.faces.component.NamingContainer, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.UniqueIdVendor, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, LibraryLocationAware, org.apache.myfaces.component.LocationAware, org.apache.myfaces.custom.tree2.Tree

@JSFComponent(name="t:tree2",
              clazz="org.apache.myfaces.custom.tree2.HtmlTree",
              tagClass="org.apache.myfaces.custom.tree2.TreeTag",
              tagHandler="org.apache.myfaces.custom.tree2.HtmlTreeTagHandler")
public abstract class AbstractHtmlTree
extends UITreeData
implements org.apache.myfaces.component.LocationAware, LibraryLocationAware

Represents "tree data" in an HTML format. Also provides a mechanism for maintaining expand/collapse state of the nodes in the tree. A component that provides an HTML-based tree from data supplied by a backing bean. The tree is highly customizable and allows for fine-grained control over the appearance of each of the nodes depending on their type. Almost any type of JSF component (text, image, checkbox, etc.) can be rendered inside the nodes and there is an option for client-side or server-side toggling of the expand/collapse state. Unless otherwise specified, all attributes accept static values or EL expressions.

Since:
1.1.7
Author:
Sean Schofield

Nested Class Summary
protected static class AbstractHtmlTree.PropertyKeys
           
 
Field Summary
static String COMPONENT_TYPE
           
 
Fields inherited from class org.apache.myfaces.custom.tree2.UITreeData
COMPONENT_FAMILY
 
Fields inherited from class javax.faces.component.UIComponent
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY
 
Fields inherited from interface org.apache.myfaces.component.LibraryLocationAware
IMAGE_LIBRARY_ATTR, JAVASCRIPT_LIBRARY_ATTR, STYLE_LIBRARY_ATTR
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
AbstractHtmlTree()
           
 
Method Summary
 javax.faces.component.UICommand getExpandControl()
          Gets the expand/collapse control that can be used to handle expand/collapse nodes.
 String getVarNodeToggler()
          Gets
 boolean isClientSideToggle()
          Perform client-side toggling of expand/collapse state via javascript (default is true.)
abstract  boolean isPreserveToggle()
          Preserve changes in client-side toggle information between requests (default is true.)
abstract  boolean isShowLines()
          Show the connecting lines (default is true.)
abstract  boolean isShowNav()
          Show the "plus" and "minus" navigation icons (default is true.) Value is ignored if clientSideToggle is true.
abstract  boolean isShowRootNode()
          Include the root node when rendering the tree (default is true.)
protected  void processNodes(javax.faces.context.FacesContext context, int processAction, org.apache.myfaces.custom.tree2.TreeWalker walker)
           
 void setClientSideToggle(boolean clientSideToggle)
          Sets
 void setNodeId(String nodeId)
           
 void setVarNodeToggler(String varNodeToggler)
           
 
Methods inherited from class org.apache.myfaces.custom.tree2.UITreeData
broadcast, collapseAll, collapsePath, createUniqueId, encodeBegin, encodeEnd, expandAll, expandPath, getContainerClientId, getDataModel, getFacesContext, getFamily, getModel, getNode, getNodeId, getPathInformation, getValue, getVar, invokeOnComponent, isLastChild, isNodeExpanded, isNodeSelected, processDecodes, processUpdates, processValidators, queueEvent, restoreState, saveState, setModel, setNodeSelected, setValue, setValueBinding, setVar, toggleExpanded, visitTree
 
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, clearInitialState, decode, encodeAll, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, initialStateMarked, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
getClientId, getCompositeComponentParent, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.component.LocationAware
getImageLocation, getJavascriptLocation, getStyleLocation
 
Methods inherited from interface org.apache.myfaces.component.LibraryLocationAware
getImageLibrary, getJavascriptLibrary, getStyleLibrary
 

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values
Constructor Detail

AbstractHtmlTree

public AbstractHtmlTree()
Method Detail

isClientSideToggle

@JSFProperty(defaultValue="true")
public boolean isClientSideToggle()
Perform client-side toggling of expand/collapse state via javascript (default is true.)

Returns:
the new clientSideToggle value

setClientSideToggle

public void setClientSideToggle(boolean clientSideToggle)
Sets

Parameters:
clientSideToggle - the new clientSideToggle value

processNodes

protected void processNodes(javax.faces.context.FacesContext context,
                            int processAction,
                            org.apache.myfaces.custom.tree2.TreeWalker walker)
Overrides:
processNodes in class UITreeData
See Also:
UITreeData.processNodes(javax.faces.context.FacesContext, int, org.apache.myfaces.custom.tree2.TreeWalker)

setNodeId

public void setNodeId(String nodeId)
Specified by:
setNodeId in interface org.apache.myfaces.custom.tree2.Tree
Overrides:
setNodeId in class UITreeData

getExpandControl

public javax.faces.component.UICommand getExpandControl()
Gets the expand/collapse control that can be used to handle expand/collapse nodes. This is only used in server-side mode. It allows the nagivation controls (if any) to be clickable as well as any commandLinks the user has set up in their JSP.

Returns:
UICommand

getVarNodeToggler

@JSFProperty(literalOnly=true)
public String getVarNodeToggler()
Gets

Returns:
the new varNodeToggler value

setVarNodeToggler

public void setVarNodeToggler(String varNodeToggler)

isShowNav

@JSFProperty(defaultValue="true")
public abstract boolean isShowNav()
Show the "plus" and "minus" navigation icons (default is true.) Value is ignored if clientSideToggle is true.


isShowLines

@JSFProperty(defaultValue="true")
public abstract boolean isShowLines()
Show the connecting lines (default is true.)


isShowRootNode

@JSFProperty(defaultValue="true")
public abstract boolean isShowRootNode()
Include the root node when rendering the tree (default is true.)


isPreserveToggle

@JSFProperty(defaultValue="true")
public abstract boolean isPreserveToggle()
Preserve changes in client-side toggle information between requests (default is true.)



Copyright © 2012 The Apache Software Foundation. All Rights Reserved.