Package org.omnifaces.component.tree
Class TreeNode
- 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
 
 public class TreeNode extends TreeFamily The <o:treeNode>is anUIComponentthat represents a single tree node within a parentTreecomponent. Within this component, thevarattribute of the parentTreecomponent will expose the tree node. Each of its children is processed byTreeNodeItem.The levelattribute can be used to specify for which tree node level as obtained byTreeModel.getLevel()this component should render the children byTreeNodeItem. The root tree node has level 0.- Author:
- Bauke Scholtz
- See Also:
- Tree,- TreeNodeItem
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCOMPONENT_TYPEThe component type, which is "org.omnifaces.component.tree.TreeNode".- 
Fields inherited from class org.omnifaces.component.tree.TreeFamilyCOMPONENT_FAMILY
 - 
Fields inherited from class jakarta.faces.component.UIComponentATTRS_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 SummaryConstructors Constructor Description TreeNode()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetLevel()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.voidsetLevel(Integer level)Sets the level for which this node should render the items.protected voidvalidateHierarchy()Validate the component hierarchy.- 
Methods inherited from class org.omnifaces.component.tree.TreeFamilyencodeChildren, getFamily, getRendersChildren, processDecodes, processSuper, processUpdates, processValidators
 - 
Methods inherited from class jakarta.faces.component.UIComponentBaseaddClientBehavior, 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.UIComponentencodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree
 
- 
 
- 
- 
- 
Field Detail- 
COMPONENT_TYPEpublic static final String COMPONENT_TYPE The component type, which is "org.omnifaces.component.tree.TreeNode".- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
validateHierarchyprotected void validateHierarchy() Validate the component hierarchy.- Specified by:
- validateHierarchyin class- TreeFamily
- Throws:
- IllegalStateException- When the direct parent component isn't of type- Tree, or when this component is nested in another- TreeNode, or when there aren't any children of type- TreeNodeItem.
 
 - 
processprotected void process(FacesContext context, PhaseId phaseId) This method is by design only called byTree.processTreeNode(FacesContext, PhaseId)as it maintains all the nodes.- Specified by:
- processin class- TreeFamily
- Parameters:
- context- The faces context to work with.
- phaseId- The current phase ID.
- See Also:
- Tree.processTreeNode(FacesContext, PhaseId)
 
 - 
getLevelpublic Integer getLevel() Returns the level for which this node should render the items.- Returns:
- The level for which this node should render the items.
 
 - 
setLevelpublic void setLevel(Integer level) Sets the level for which this node should render the items.- Parameters:
- level- The level for which this node should render the items.
 
 
- 
 
-