org.icefaces.ace.component.tree

## Class TreeBase

- java.lang.Object
- - javax.faces.component.UIComponent
  - - javax.faces.component.UIComponentBase
    - - javax.faces.component.UIData
      - - org.icefaces.ace.component.tree.TreeBase

- All Implemented Interfaces:
    java.util.EventListener, javax.faces.component.behavior.ClientBehaviorHolder, javax.faces.component.NamingContainer, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.TransientStateHolder, javax.faces.component.UniqueIdVendor, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, IceClientBehaviorHolder, ITree
  Direct Known Subclasses:
    Tree

      public abstract class TreeBase
      extends javax.faces.component.UIData
      implements ITree, IceClientBehaviorHolder

  Renders a hierarchical structure of ace:node contents. Supports client-side and server-side node selection and expansion. Other features available include: user reordering of nodes, multiple selection and lazy node state initialization.

  For more information, see the Tree Wiki Documentation.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `TreeBase.PropertyKeys`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `COMPONENT_TYPE`
    `static java.lang.String` | `RENDERER_TYPE`

    - ### Fields inherited from class javax.faces.component.UIData

      `COMPONENT_FAMILY`

    - ### Fields inherited from class javax.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`

    - ### Fields inherited from interface javax.faces.component.NamingContainer

      `SEPARATOR_CHAR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TreeBase()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addClientBehavior(java.lang.String eventName, javax.faces.component.behavior.ClientBehavior behavior)`
    `java.lang.String` | `getDefaultEventName()`
    `java.lang.String` | `getDefaultExecute(java.lang.String event)`
    `java.lang.String` | `getDefaultRender(java.lang.String event)`
    `java.util.Collection<java.lang.String>` | `getEventNames()`
    `TreeExpansionMode` | `getExpansionMode()` Return the value of the `expansionMode` property.
    `java.lang.String` | `getFamily()`
    `javax.faces.component.UIComponent` | `getIconFacet()` Return the value of the `icon facet` property.
    `KeySegmentConverter` | `getKeyConverter()` Return the value of the `keyConverter` property.
    `java.lang.String` | `getListenerArgument(java.lang.String event)`
    `TreeSelectionMode` | `getSelectionMode()` Return the value of the `selectionMode` property.
    `NodeStateCreationCallback` | `getStateCreationCallback()` Return the value of the `stateCreationCallback` property.
    `NodeStateMap` | `getStateMap()` Return the value of the `stateMap` property.
    `java.lang.String` | `getStateVar()` Return the value of the `stateVar` property.
    `java.lang.String` | `getType()` Return the value of the `type` property.
    `java.lang.Boolean` | `isExpansion()` Return the value of the `expansion` property.
    `protected boolean` | `isPropertySet(java.lang.String finder)`
    `java.lang.Boolean` | `isReordering()` Return the value of the `reordering` property.
    `java.lang.Boolean` | `isSelection()` Return the value of the `selection` property.
    `java.lang.Boolean` | `isSelectMultiple()` Return the value of the `selectMultiple` property.
    `void` | `setExpansion(java.lang.Boolean expansion)` Set the value of the `expansion` property.
    `void` | `setExpansionMode(TreeExpansionMode expansionMode)` Set the value of the `expansionMode` property.
    `void` | `setIconFacet(javax.faces.component.UIComponent icon)` Set the value of the `icon facet` property.
    `void` | `setKeyConverter(KeySegmentConverter keyConverter)` Set the value of the `keyConverter` property.
    `void` | `setReordering(java.lang.Boolean reordering)` Set the value of the `reordering` property.
    `void` | `setSelection(java.lang.Boolean selection)` Set the value of the `selection` property.
    `void` | `setSelectionMode(TreeSelectionMode selectionMode)` Set the value of the `selectionMode` property.
    `void` | `setSelectMultiple(java.lang.Boolean selectMultiple)` Set the value of the `selectMultiple` property.
    `void` | `setStateCreationCallback(NodeStateCreationCallback stateCreationCallback)` Set the value of the `stateCreationCallback` property.
    `void` | `setStateMap(NodeStateMap stateMap)` Set the value of the `stateMap` property.
    `void` | `setStateVar(java.lang.String stateVar)` Set the value of the `stateVar` property.
    `void` | `setType(java.lang.String type)` Set the value of the `type` property.
    `void` | `setValueExpression(java.lang.String name, javax.el.ValueExpression binding)`

    - ### Methods inherited from class javax.faces.component.UIData

      `broadcast, createUniqueId, encodeBegin, getClientId, getDataModel, getFirst, getFooter, getHeader, getRowCount, getRowData, getRowIndex, getRows, getValue, getVar, invokeOnComponent, isRowAvailable, isRowStatePreserved, markInitialState, processDecodes, processUpdates, processValidators, queueEvent, restoreState, saveState, setDataModel, setFirst, setFooter, setHeader, setRowIndex, setRows, setRowStatePreserved, setValue, setValueBinding, setVar, visitTree`

    - ### Methods inherited from class javax.faces.component.UIComponentBase

      `addFacesListener, clearInitialState, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, subscribeToEvent, unsubscribeFromEvent`

    - ### Methods inherited from class javax.faces.component.UIComponent

      `encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface javax.faces.component.behavior.ClientBehaviorHolder

      `getClientBehaviors`

- - ### Field Detail

    - #### COMPONENT_TYPE

          public static final java.lang.String COMPONENT_TYPE

      See Also:
        Constant Field Values

    - #### RENDERER_TYPE

          public static final java.lang.String RENDERER_TYPE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TreeBase

          public TreeBase()

  - ### Method Detail

    - #### getFamily

          public java.lang.String getFamily()

      Overrides:
        `getFamily` in class `javax.faces.component.UIData`

    - #### setExpansion

          public void setExpansion(java.lang.Boolean expansion)

      Set the value of the `expansion` property.

      Contents: Enable expansion feature of this tree component. This toggles this feature for the entire tree, per-node configuration of this feature available via the NodeState.

      Specified by:
        `setExpansion` in interface `ITree`

    - #### isExpansion

          public java.lang.Boolean isExpansion()

      Return the value of the `expansion` property.

      Contents: Enable expansion feature of this tree component. This toggles this feature for the entire tree, per-node configuration of this feature available via the NodeState. Default = 'false'.

      Specified by:
        `isExpansion` in interface `ITree`

    - #### setExpansionMode

          public void setExpansionMode(TreeExpansionMode expansionMode)

      Set the value of the `expansionMode` property.

      Contents: Select the request behaviour of the expansion feature. When 'client', the children of every node are pre-rendered in the DOM and exposed by JavaScript when nodes are expanded. In the default 'server' mode, only visible nodes are inthe DOM and expansion and contraction are caused by ajax page updates.

      Specified by:
        `setExpansionMode` in interface `ITree`

    - #### getExpansionMode

          public TreeExpansionMode getExpansionMode()

      Return the value of the `expansionMode` property.

      Contents: Select the request behaviour of the expansion feature. When 'client', the children of every node are pre-rendered in the DOM and exposed by JavaScript when nodes are expanded. In the default 'server' mode, only visible nodes are inthe DOM and expansion and contraction are caused by ajax page updates. Default = 'org.icefaces.ace.component.tree.TreeExpansionMode.server'.

      Specified by:
        `getExpansionMode` in interface `ITree`

    - #### setKeyConverter

          public void setKeyConverter(KeySegmentConverter keyConverter)

      Set the value of the `keyConverter` property.

      Contents: Optionally define a custom KeySegmentConverter object to produce segmented identifier keys for nodes based on something other than indexes.

      Specified by:
        `setKeyConverter` in interface `ITree`

    - #### getKeyConverter

          public KeySegmentConverter getKeyConverter()

      Return the value of the `keyConverter` property.

      Contents: Optionally define a custom KeySegmentConverter object to produce segmented identifier keys for nodes based on something other than indexes.

      Specified by:
        `getKeyConverter` in interface `ITree`

    - #### setReordering

          public void setReordering(java.lang.Boolean reordering)

      Set the value of the `reordering` property.

      Contents: Enable reordering of the nodes of this tree.

      Specified by:
        `setReordering` in interface `ITree`

    - #### isReordering

          public java.lang.Boolean isReordering()

      Return the value of the `reordering` property.

      Contents: Enable reordering of the nodes of this tree. Default = 'false'.

      Specified by:
        `isReordering` in interface `ITree`

    - #### setSelectMultiple

          public void setSelectMultiple(java.lang.Boolean selectMultiple)

      Set the value of the `selectMultiple` property.

      Contents: Disable the selection of multiple nodes simultaneously.

      Specified by:
        `setSelectMultiple` in interface `ITree`

    - #### isSelectMultiple

          public java.lang.Boolean isSelectMultiple()

      Return the value of the `selectMultiple` property.

      Contents: Disable the selection of multiple nodes simultaneously. Default = 'true'.

      Specified by:
        `isSelectMultiple` in interface `ITree`

    - #### setSelection

          public void setSelection(java.lang.Boolean selection)

      Set the value of the `selection` property.

      Contents: Enable selection feature of this tree component. This toggles this feature for the entire tree, per-node configuration of this feature available via the NodeState.

      Specified by:
        `setSelection` in interface `ITree`

    - #### isSelection

          public java.lang.Boolean isSelection()

      Return the value of the `selection` property.

      Contents: Enable selection feature of this tree component. This toggles this feature for the entire tree, per-node configuration of this feature available via the NodeState. Default = 'false'.

      Specified by:
        `isSelection` in interface `ITree`

    - #### setSelectionMode

          public void setSelectionMode(TreeSelectionMode selectionMode)

      Set the value of the `selectionMode` property.

      Contents: Select the request behaviour of the selection feature. When 'client', the (de)selection of a node is recorded on the client, and communicated to the server on the next request executing this component. In the default 'server' mode, when a node is (de)selected, the component communicates the change the server immediately with an ajax update.

      Specified by:
        `setSelectionMode` in interface `ITree`

    - #### getSelectionMode

          public TreeSelectionMode getSelectionMode()

      Return the value of the `selectionMode` property.

      Contents: Select the request behaviour of the selection feature. When 'client', the (de)selection of a node is recorded on the client, and communicated to the server on the next request executing this component. In the default 'server' mode, when a node is (de)selected, the component communicates the change the server immediately with an ajax update. Default = 'org.icefaces.ace.component.tree.TreeSelectionMode.server'.

      Specified by:
        `getSelectionMode` in interface `ITree`

    - #### setStateCreationCallback

          public void setStateCreationCallback(NodeStateCreationCallback stateCreationCallback)

      Set the value of the `stateCreationCallback` property.

      Contents: Bind an implementer of the NodeStateCreationCallback interface to take as input, a node object and a default NodeState and return a NodeState configured with the state appropriatefor the given node object.

      Specified by:
        `setStateCreationCallback` in interface `ITree`

    - #### getStateCreationCallback

          public NodeStateCreationCallback getStateCreationCallback()

      Return the value of the `stateCreationCallback` property.

      Contents: Bind an implementer of the NodeStateCreationCallback interface to take as input, a node object and a default NodeState and return a NodeState configured with the state appropriatefor the given node object.

      Specified by:
        `getStateCreationCallback` in interface `ITree`

    - #### setStateMap

          public void setStateMap(NodeStateMap stateMap)

      Set the value of the `stateMap` property.

      Contents: Define a NodeStateMap ValueExpression to access the store of Tree node object state information. The state map provides an API for looking up the state of a particular node object, as well as reverse look-ups to get node objects with a particular state.

      Specified by:
        `setStateMap` in interface `ITree`

    - #### getStateMap

          public NodeStateMap getStateMap()

      Return the value of the `stateMap` property.

      Contents: Define a NodeStateMap ValueExpression to access the store of Tree node object state information. The state map provides an API for looking up the state of a particular node object, as well as reverse look-ups to get node objects with a particular state.

      Specified by:
        `getStateMap` in interface `ITree`

    - #### setStateVar

          public void setStateVar(java.lang.String stateVar)

      Set the value of the `stateVar` property.

      Contents: The request-scope attribute exposing the state object for the currentnode when iterating.

      Specified by:
        `setStateVar` in interface `ITree`

    - #### getStateVar

          public java.lang.String getStateVar()

      Return the value of the `stateVar` property.

      Contents: The request-scope attribute exposing the state object for the currentnode when iterating. Default = 'nodeState'.

      Specified by:
        `getStateVar` in interface `ITree`

    - #### setType

          public void setType(java.lang.String type)

      Set the value of the `type` property.

      Contents: Define a ValueExpression that returns a String representation of the 'rendering type' of this node. The rendering type is matched against the String 'type' attribute of ace:node tag instances to determine which node template should be used to render a given node object.

      Specified by:
        `setType` in interface `ITree`

    - #### getType

          public java.lang.String getType()

      Return the value of the `type` property.

      Contents: Define a ValueExpression that returns a String representation of the 'rendering type' of this node. The rendering type is matched against the String 'type' attribute of ace:node tag instances to determine which node template should be used to render a given node object.

      Specified by:
        `getType` in interface `ITree`

    - #### setIconFacet

          public void setIconFacet(javax.faces.component.UIComponent icon)

      Set the value of the `icon facet` property.

    - #### getIconFacet

          public javax.faces.component.UIComponent getIconFacet()

      Return the value of the `icon facet` property.

    - #### isPropertySet

          protected boolean isPropertySet(java.lang.String finder)

    - #### setValueExpression

          public void setValueExpression(java.lang.String name,
                                         javax.el.ValueExpression binding)

      Overrides:
        `setValueExpression` in class `javax.faces.component.UIData`

    - #### getEventNames

          public java.util.Collection<java.lang.String> getEventNames()

      Specified by:
        `getEventNames` in interface `javax.faces.component.behavior.ClientBehaviorHolder`
      Overrides:
        `getEventNames` in class `javax.faces.component.UIComponentBase`

    - #### getDefaultEventName

          public java.lang.String getDefaultEventName()

      Specified by:
        `getDefaultEventName` in interface `javax.faces.component.behavior.ClientBehaviorHolder`
      Overrides:
        `getDefaultEventName` in class `javax.faces.component.UIComponentBase`

    - #### getDefaultRender

          public java.lang.String getDefaultRender(java.lang.String event)

      Specified by:
        `getDefaultRender` in interface `IceClientBehaviorHolder`

    - #### getDefaultExecute

          public java.lang.String getDefaultExecute(java.lang.String event)

      Specified by:
        `getDefaultExecute` in interface `IceClientBehaviorHolder`

    - #### getListenerArgument

          public java.lang.String getListenerArgument(java.lang.String event)

      Specified by:
        `getListenerArgument` in interface `IceClientBehaviorHolder`

    - #### addClientBehavior

          public void addClientBehavior(java.lang.String eventName,
                                        javax.faces.component.behavior.ClientBehavior behavior)

      Specified by:
        `addClientBehavior` in interface `javax.faces.component.behavior.ClientBehaviorHolder`
      Overrides:
        `addClientBehavior` in class `javax.faces.component.UIComponentBase`

Copyright 2025 ICEsoft Technologies Canada, Corp. All Rights Reserved.