- 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 anUIComponentthat represents a single child tree node within a parentTreeNodecomponent. Within this component, thevarattribute of the parentTreecomponent will expose the child tree node.This component allows a child component of type
TreeInsertChildrenwhich indicates the place to insert the children of the current child tree node recursively by aTreeNodecomponent associated with the children's level in the same parentTreecomponent.- Author:
- Bauke Scholtz
- See Also:
TreeNode,TreeInsertChildren
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENT_TYPEThe 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 voidencodeAll(FacesContext context)Suppress default behavior ofencodeAll(FacesContext)(which also checksUIComponentBase.isRendered()) by delegating directly toTreeFamily.encodeChildren(FacesContext).protected voidprocess(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 voidvalidateHierarchy()Validate the component hierarchy.booleanvisitTree(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
-
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()
Validate the component hierarchy.- Specified by:
validateHierarchyin classTreeFamily- 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:
encodeAllin 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:
processin 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:
visitTreein classUIComponent- Parameters:
context- The visit context to work with.callback- The visit callback to work with.- See Also:
Tree.setCurrentModelNode(FacesContext, TreeModel)
-
-