org.omnifaces.component.tree
Class TreeNodeItem

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.omnifaces.component.tree.TreeFamily
              extended by org.omnifaces.component.tree.TreeNodeItem
All Implemented Interfaces:
java.util.EventListener, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder

public class TreeNodeItem
extends TreeFamily

TreeNodeItem is an UIComponent that represents a single child tree node within a parent TreeNode component. Within this component, the var attribute of the parent Tree component will expose the child tree node.

This component allows a child component of type TreeInsertChildren which indicates the place to insert the children of the current child tree node recursively by a TreeNode component associated with the children's level in the same parent Tree component.

Author:
Bauke Scholtz
See Also:
TreeNode, TreeInsertChildren

Field Summary
static java.lang.String COMPONENT_TYPE
          The standard component type.
 
Fields inherited from class org.omnifaces.component.tree.TreeFamily
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
 
Constructor Summary
TreeNodeItem()
           
 
Method Summary
 void encodeAll(javax.faces.context.FacesContext context)
          Suppress default behavior of encodeAll(FacesContext) (which also checks UIComponentBase.isRendered()) by delegating directly to TreeFamily.encodeChildren(FacesContext).
protected  void process(javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId)
          Loop over children of the current model node, set the child as the current model node and continue processing this component according to the rules of the given phase ID.
protected  void validateHierarchy()
          Validate the component hierarchy.
 boolean visitTree(javax.faces.component.visit.VisitContext context, javax.faces.component.visit.VisitCallback callback)
          Loop over children of the current model node, set the child as the current model node and continue visiting this component according to the given visit context and callback.
 
Methods inherited from class org.omnifaces.component.tree.TreeFamily
encodeChildren, getFamily, getRendersChildren, processDecodes, processSuper, processUpdates, processValidators
 
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, initialStateMarked, 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
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
The standard component type.

See Also:
Constant Field Values
Constructor Detail

TreeNodeItem

public TreeNodeItem()
Method Detail

validateHierarchy

protected void validateHierarchy()
Validate the component hierarchy.

Specified by:
validateHierarchy in class TreeFamily
Throws:
java.lang.IllegalArgumentException - When there is no parent of type Tree, or when this component is nested in another TreeNodeItem.

encodeAll

public void encodeAll(javax.faces.context.FacesContext context)
               throws java.io.IOException
Suppress default behavior of encodeAll(FacesContext) (which also checks UIComponentBase.isRendered()) by delegating directly to TreeFamily.encodeChildren(FacesContext).

Overrides:
encodeAll in class javax.faces.component.UIComponent
Throws:
java.io.IOException

process

protected void process(javax.faces.context.FacesContext context,
                       javax.faces.event.PhaseId phaseId)
Loop over children of the current model node, set the child as the current model node and continue processing this component according to the rules of the given phase ID.

Specified by:
process in class TreeFamily
Parameters:
context - The faces context to work with.
phaseId - The current phase ID.
See Also:
Tree.setCurrentModelNode(FacesContext, TreeModel)

visitTree

public boolean visitTree(javax.faces.component.visit.VisitContext context,
                         javax.faces.component.visit.VisitCallback callback)
Loop over children of the current model node, set the child as the current model node and continue visiting this component according to the given visit context and callback.

Overrides:
visitTree in class javax.faces.component.UIComponent
Parameters:
context - The visit context to work with.
callback - The visit callback to work with.
See Also:
Tree.setCurrentModelNode(FacesContext, TreeModel)