- java.lang.Object
-
- jakarta.faces.component.UIComponent
-
- jakarta.faces.component.UIComponentBase
-
- org.omnifaces.component.tree.TreeFamily
-
- org.omnifaces.component.tree.TreeNodeItem
-
- All Implemented Interfaces:
PartialStateHolder
,StateHolder
,TransientStateHolder
,ComponentSystemEventListener
,FacesListener
,SystemEventListenerHolder
,EventListener
public class TreeNodeItem extends TreeFamily
The
<o:treeNodeItem>
is anUIComponent
that represents a single child tree node within a parentTreeNode
component. Within this component, thevar
attribute of the parentTree
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 aTreeNode
component associated with the children's level in the same parentTree
component.- Author:
- Bauke Scholtz
- See Also:
TreeNode
,TreeInsertChildren
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_TYPE
The component type, which is "org.omnifaces.component.tree.TreeNodeItem".-
Fields inherited from class org.omnifaces.component.tree.TreeFamily
COMPONENT_FAMILY
-
Fields inherited from class jakarta.faces.component.UIComponent
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY
-
-
Constructor Summary
Constructors Constructor Description TreeNodeItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encodeAll(FacesContext context)
Suppress default behavior ofencodeAll(FacesContext)
(which also checksUIComponentBase.isRendered()
) by delegating directly toTreeFamily.encodeChildren(FacesContext)
.protected void
process(FacesContext context, 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(FacesContext context)
Validate the component hierarchy.boolean
visitTree(VisitContext context, 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, validateHierarchy
-
Methods inherited from class jakarta.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, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent
-
Methods inherited from class jakarta.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression
-
-
-
-
Field Detail
-
COMPONENT_TYPE
public static final String COMPONENT_TYPE
The component type, which is "org.omnifaces.component.tree.TreeNodeItem".- See Also:
- Constant Field Values
-
-
Method Detail
-
validateHierarchy
protected void validateHierarchy(FacesContext context)
Validate the component hierarchy.- Specified by:
validateHierarchy
in classTreeFamily
- Parameters:
context
- The faces context to work with.- Throws:
IllegalStateException
- When there is no parent of typeTreeNode
, or when this component is nested in anotherTreeNodeItem
.
-
encodeAll
public void encodeAll(FacesContext context) throws IOException
Suppress default behavior ofencodeAll(FacesContext)
(which also checksUIComponentBase.isRendered()
) by delegating directly toTreeFamily.encodeChildren(FacesContext)
.- Overrides:
encodeAll
in classUIComponent
- Throws:
IOException
-
process
protected void process(FacesContext context, 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 classTreeFamily
- Parameters:
context
- The faces context to work with.phaseId
- The current phase ID.- See Also:
Tree.setCurrentModelNode(FacesContext, TreeModel)
-
visitTree
public boolean visitTree(VisitContext context, 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 classUIComponent
- Parameters:
context
- The visit context to work with.callback
- The visit callback to work with.- See Also:
Tree.setCurrentModelNode(FacesContext, TreeModel)
-
-