java.lang.Object
jakarta.faces.component.UIComponent
jakarta.faces.component.UIComponentBase
org.omnifaces.component.tree.TreeFamily
org.omnifaces.component.tree.TreeNode
- All Implemented Interfaces:
PartialStateHolder,StateHolder,TransientStateHolder,ComponentSystemEventListener,FacesListener,SystemEventListenerHolder,EventListener
The <o:treeNode> is an UIComponent that represents a single tree node within a parent
Tree component. Within this component, the var attribute of the parent Tree
component will expose the tree node. Each of its children is processed by TreeNodeItem.
The level attribute can be used to specify for which tree node level as obtained by
TreeModel.getLevel() this component should render the children by TreeNodeItem. The root tree node
has level 0.
- Author:
- Bauke Scholtz
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe component type, which is "org.omnifaces.component.tree.TreeNode".Fields inherited from class org.omnifaces.component.tree.TreeFamily
COMPONENT_FAMILYFields inherited from class jakarta.faces.component.UIComponent
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, FACETS_KEY, VIEW_LOCATION_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLevel()Returns the level for which this node should render the items.protected voidprocess(FacesContext context, PhaseId phaseId) This method is by design only called byTree.processTreeNode(FacesContext, PhaseId)as it maintains all the nodes.voidSets the level for which this node should render the items.protected voidvalidateHierarchy(FacesContext context) Validate the component hierarchy.Methods inherited from class org.omnifaces.component.tree.TreeFamily
encodeChildren, getFamily, getRendersChildren, processDecodes, processSuper, processUpdates, processValidatorsMethods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeAll, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getPassThroughAttributes, getRenderer, getRendererType, invokeOnComponent, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, visitTreeMethods inherited from class jakarta.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
-
Field Details
-
COMPONENT_TYPE
The component type, which is "org.omnifaces.component.tree.TreeNode".- See Also:
-
-
Constructor Details
-
TreeNode
public TreeNode()
-
-
Method Details
-
validateHierarchy
Validate the component hierarchy.- Specified by:
validateHierarchyin classTreeFamily- Parameters:
context- The faces context to work with.- Throws:
IllegalStateException- When the direct parent component isn't of typeTree, or when this component is nested in anotherTreeNode, or when there aren't any children of typeTreeNodeItem.
-
process
This method is by design only called byTree.processTreeNode(FacesContext, PhaseId)as it maintains all the nodes.- Specified by:
processin classTreeFamily- Parameters:
context- The faces context to work with.phaseId- The current phase ID.- See Also:
-
getLevel
Returns the level for which this node should render the items.- Returns:
- The level for which this node should render the items.
-
setLevel
Sets the level for which this node should render the items.- Parameters:
level- The level for which this node should render the items.
-