org.apache.myfaces.trinidad.component
Class UIXTreeTable

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by org.apache.myfaces.trinidad.component.UIXComponent
          extended by org.apache.myfaces.trinidad.component.UIXComponentBase
              extended by org.apache.myfaces.trinidad.component.UIXCollection
                  extended by org.apache.myfaces.trinidad.component.UIXHierarchy
                      extended by org.apache.myfaces.trinidad.component.UIXTree
                          extended by org.apache.myfaces.trinidad.component.UIXTreeTable
All Implemented Interfaces:
EventListener, javax.faces.component.NamingContainer, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, CollectionComponent, LocalRowKeyIndex, RowKeyIndex, TreeLocalRowKeyIndex
Direct Known Subclasses:
CoreTreeTable

public class UIXTreeTable
extends UIXTree

The Apache Trinidad TreeTable is used to display data that is structured in a hierarchical format. This component displays a hierarchy in a UI similar to a Trinidad Table, and is more elaborate than the Tree component. TreeTable supports displaying columns of data per element in the hierarchy. Unlike the Tree component, TreeTable only supports single rooted hierarchies. The features of the TreeTable component include mechanisms for focusing in on subtrees (within the main tree), as well as expanding and collapsing elements in the hierarchy. Like the Table, the TreeTable's children must be Trinidad Column components. Like the Tree, the TreeTable has a "nodeStamp" facet which renders the "Object Name" Column. The "Object Name" Column contains the primary identifier of an element in the hierarchy. For example, in an organization chart of employees, the "Object Name" Column might be the employee name.

Events:

Type Phases Description
org.apache.myfaces.trinidad.event.RowDisclosureEvent Apply
Request
Values
Invoke
Application
The expansion event is generated for a table when the detail facet of a row is expanded or collapsed. For tree or a treeTable, the expansion event is generated when tree nodes are expanded or collapsed.
org.apache.myfaces.trinidad.event.SelectionEvent Apply
Request
Values
Invoke
Application
The selection event is delivered when the table selection changes.
org.apache.myfaces.trinidad.event.FocusEvent Apply
Request
Values
Invoke
Application
Event delivered when user clicks to focus on (or zoom into) a particular element's subtree of children. The TreeTable responds to this event by modifying the "focusPath" property appropriately. Subsequently, any registered FocusListener instances are called.
org.apache.myfaces.trinidad.event.AttributeChangeEvent Invoke
Application
Apply
Request
Values
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.myfaces.trinidad.component.UIXCollection
UIXCollection.NoColumnFacetsVisitContext
 
Nested classes/interfaces inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex
LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy
 
Field Summary
static String COMPONENT_FAMILY
           
static String COMPONENT_TYPE
           
static PropertyKey RANGE_CHANGE_LISTENER_KEY
           
static PropertyKey ROOT_NODE_RENDERED_KEY
           
static PropertyKey ROWS_BY_DEPTH_KEY
           
static FacesBean.Type TYPE
           
 
Fields inherited from class org.apache.myfaces.trinidad.component.UIXTree
DISCLOSED_ROW_KEYS_KEY, FOCUS_LISTENER_KEY, FOCUS_ROW_KEY_KEY, IMMEDIATE_KEY, INITIALLY_EXPANDED_KEY, NODE_STAMP_FACET, ROW_DISCLOSURE_LISTENER_KEY, SELECTED_ROW_KEYS_KEY, SELECTION_LISTENER_KEY, VALUE_KEY, VAR_STATUS_KEY
 
Fields inherited from class org.apache.myfaces.trinidad.component.UIXCollection
VAR_KEY
 
Fields inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase
BINDING_KEY, ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY
 
Fields inherited from class javax.faces.component.UIComponent
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
  UIXTreeTable()
          Construct an instance of the UIXTreeTable.
protected UIXTreeTable(String rendererType)
          Construct an instance of the UIXTreeTable.
 
Method Summary
protected  void __encodeBegin(javax.faces.context.FacesContext context)
          Override to update the container client id cache before encode
 void addRangeChangeListener(RangeChangeListener listener)
          Adds a RangeChangeListener.
 void broadcast(javax.faces.event.FacesEvent event)
          Delivers an event.
 void decode(javax.faces.context.FacesContext context)
          Override to update the container client id cache before decode
protected  FacesBean.Type getBeanType()
           
 String getContainerClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent child)
          Override to return clientd ids with no currency for items in header/footer facets
 String getFamily()
           
 int getFirst()
          Gets the range start index for the current collection.
 javax.el.MethodExpression getRangeChangeListener()
          Gets a method reference to a rangeChange listener that will be called when a new range is selected.
 RangeChangeListener[] getRangeChangeListeners()
          Retrieves all RangeChangeListeners
 int getRows()
          Gets the maximum number of rows to show.
 int[] getRowsByDepth()
          Gets the maximum number of records that can be displayed at one time (range size).
protected  List<javax.faces.component.UIComponent> getStamps()
          Gets the stamps.
 boolean isRootNodeRendered()
          Gets If the root node should be rendered or not.
protected  void processFacetsAndChildren(javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId)
          Process this component's facets and children.
 void processUpdates(javax.faces.context.FacesContext context)
          Override to update the container client id cache before updates
 void processValidators(javax.faces.context.FacesContext context)
          Override to update the container client id cache before validations
 void removeRangeChangeListener(RangeChangeListener listener)
          Removes a RangeChangeListener.
protected  void restoreStampState(javax.faces.context.FacesContext context, javax.faces.component.UIComponent stamp, Object stampState)
          Restores the state for the given stamp.
 void restoreState(javax.faces.context.FacesContext context, Object state)
           
protected  Object saveStampState(javax.faces.context.FacesContext context, javax.faces.component.UIComponent stamp)
          Saves the state for the given stamp.
 Object saveState(javax.faces.context.FacesContext context)
           
 void setFirst(int index)
          Sets the range start index for the current collection.
 void setRangeChangeListener(javax.faces.el.MethodBinding binding)
          Deprecated. 
 void setRangeChangeListener(javax.el.MethodExpression rangeChangeListener)
          Sets a method reference to a rangeChange listener that will be called when a new range is selected.
 void setRootNodeRendered(boolean rootNodeRendered)
          Sets If the root node should be rendered or not.
 void setRowsByDepth(int[] rowsByDepth)
          Sets the maximum number of records that can be displayed at one time (range size).
protected  boolean visitChildren(javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback callback)
           Override default children visiting code to visit the facets and facets of the columns before delegating to the visitData to visit the individual rows of data.
protected  boolean visitData(javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback callback)
          Visit the rows and children of the columns of the collection per row-index.
protected  boolean visitUnstampedFacets(javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback callback)
          Hook method for subclasses to override to change the behavior of how unstamped facets of the UIXCollection are visited.
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXTree
addFocusListener, addRowDisclosureListener, addSelectionListener, createCollectionModel, createFacesBean, getDisclosedRowKeys, getFocusListener, getFocusListeners, getFocusRowKey, getNodeStamp, getRowDisclosureListener, getRowDisclosureListeners, getSelectedRowKeys, getSelectionListener, getSelectionListeners, getValue, getVarStatus, isImmediate, isInitiallyExpanded, postCreateCollectionModel, queueEvent, removeFocusListener, removeRowDisclosureListener, removeSelectionListener, setDisclosedRowKeys, setFocusListener, setFocusRowKey, setImmediate, setInitiallyExpanded, setNodeStamp, setRowDisclosureListener, setRowDisclosureListener, setSelectedRowKeys, setSelectionListener, setSelectionListener, setValue, setVarStatus
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXHierarchy
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, createVarStatusMap, enterContainer, exitContainer, getAllAncestorContainerRowKeys, getContainerRowKey, getContainerRowKey, getDepth, getDepth, getTreeModel, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isContainer, isContainerEmpty, visitHierarchy, visitLevel
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXCollection
areRowsAvailable, areRowsAvailable, areRowsAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearCurrencyStringCache, clearLocalCache, decodeChildrenImpl, defaultVisitChildren, encodeBegin, encodeEnd, getCachingStrategy, getClientRowKey, getClientRowKeyManager, getCollectionModel, getCollectionModel, getContainerClientId, getCurrencyString, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowCount, getRowData, getRowData, getRowData, getRowIndex, getRowKey, getSortCriteria, getVar, invokeOnComponent, isRowAvailable, isRowAvailable, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, isSortable, postRowDataChange, preRowDataChange, processComponent, processDecodes, processEvent, processRestoreState, processSaveState, resetStampState, setClientRowKey, setCurrencyString, setRowIndex, setRowKey, setSortCriteria, setupVisitingContext, setVar, tearDownVisitingContext, updateChildrenImpl, validateChildrenImpl, visitChildrenWithoutIterating
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase
adaptMethodBinding, addAttributeChange, addAttributeChangeListener, addClientBehavior, addComponentChange, addComponentChange, addFacesListener, broadcastToMethodBinding, broadcastToMethodExpression, clearInitialState, decodeChildren, encodeChildren, findComponent, getAttributeChangeListener, getAttributeChangeListeners, getAttributes, getBooleanProperty, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacetNames, getFacets, getFacetsAndChildren, getId, getIntProperty, getLifecycleRenderer, getListenersForEventClass, getParent, getProperty, getPropertyKey, getRenderedFacetsAndChildren, getRenderer, getRendererType, getRendersChildren, getValueBinding, getValueExpression, initialStateMarked, invokeOnChildrenComponents, invokeOnNamingContainerComponent, isRendered, isTransient, markInitialState, removeAttributeChangeListener, removeFacesListener, satisfiesPartialTrigger, setAttributeChangeListener, setAttributeChangeListener, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setupFlattenedChildrenContext, setupFlattenedContext, setValueBinding, setValueExpression, subscribeToEvent, tearDownFlattenedChildrenContext, tearDownFlattenedContext, toString, unsubscribeFromEvent, updateChildren, validateChildren
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXComponent
addPartialTarget, clearCachedClientIds, clearCachedClientIds, encodeFlattenedChild, encodeFlattenedChildren, getLogicalParent, getLogicalParent, getStateHelper, getStateHelper, isVisitable, partialEncodeVisit, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, setPartialTarget, setupChildrenEncodingContext, setupChildrenVisitingContext, setupEncodingContext, setUpEncodingContext, tearDownChildrenEncodingContext, tearDownChildrenVisitingContext, tearDownEncodingContext, visitAllChildren, visitChildren, visitTree, visitTree
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getResourceBundleMap, isCompositeComponent, isInView, popComponentFromEL, pushComponentToEL, setInView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.trinidad.component.CollectionComponent
getVar
 
Methods inherited from interface org.apache.myfaces.trinidad.model.RowKeyIndex
areRowsAvailable, areRowsAvailable, areRowsAvailable, getRowCount, getRowData, getRowData, getRowData, getRowIndex, getRowKey, isRowAvailable, isRowAvailable, isRowAvailable, setRowIndex, setRowKey
 
Methods inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, isRowLocallyAvailable, isRowLocallyAvailable
 

Field Detail

TYPE

public static final FacesBean.Type TYPE

ROOT_NODE_RENDERED_KEY

public static final PropertyKey ROOT_NODE_RENDERED_KEY

ROWS_BY_DEPTH_KEY

public static final PropertyKey ROWS_BY_DEPTH_KEY

RANGE_CHANGE_LISTENER_KEY

public static final PropertyKey RANGE_CHANGE_LISTENER_KEY

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY
See Also:
Constant Field Values

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values
Constructor Detail

UIXTreeTable

public UIXTreeTable()
Construct an instance of the UIXTreeTable.


UIXTreeTable

protected UIXTreeTable(String rendererType)
Construct an instance of the UIXTreeTable.

Method Detail

decode

public void decode(javax.faces.context.FacesContext context)
Override to update the container client id cache before decode

Overrides:
decode in class UIXComponentBase

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Override to update the container client id cache before validations

Overrides:
processValidators in class UIXCollection

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Override to update the container client id cache before updates

Overrides:
processUpdates in class UIXCollection

__encodeBegin

protected void __encodeBegin(javax.faces.context.FacesContext context)
                      throws IOException
Override to update the container client id cache before encode

Overrides:
__encodeBegin in class UIXTree
Throws:
IOException
See Also:
UIXCollection.__encodeBegin(javax.faces.context.FacesContext)

getContainerClientId

public String getContainerClientId(javax.faces.context.FacesContext context,
                                   javax.faces.component.UIComponent child)
Override to return clientd ids with no currency for items in header/footer facets

Overrides:
getContainerClientId in class UIXComponentBase
See Also:
UIXComponentBase.getClientId(FacesContext context)

setRangeChangeListener

@Deprecated
public void setRangeChangeListener(javax.faces.el.MethodBinding binding)
Deprecated. 


getRows

public final int getRows()
Gets the maximum number of rows to show. This changes depending on the depth of the current row in the tree hierarchy. The rows per depth is obtained from getRowsByDepth().

Specified by:
getRows in interface CollectionComponent
Overrides:
getRows in class UIXHierarchy
Returns:
0 if all rows must be shown at this level.

getFirst

public final int getFirst()
Gets the range start index for the current collection. The current collection is the children of the parent of the current rowData. ie: the current collection is the collection of siblings of the current rowData.

Specified by:
getFirst in interface CollectionComponent
Overrides:
getFirst in class UIXHierarchy
Returns:
zero based index of the row that must be displayed first.
See Also:
UIXCollection.getRowData()

setFirst

public void setFirst(int index)
Sets the range start index for the current collection. The current collection is the children of the parent of the current rowData. ie: the current collection is the collection of siblings of the current rowData.

Parameters:
index - zero based index of the row that must be displayed first.
See Also:
UIXCollection.getRowData()

addRangeChangeListener

public void addRangeChangeListener(RangeChangeListener listener)
Adds a RangeChangeListener.


removeRangeChangeListener

public void removeRangeChangeListener(RangeChangeListener listener)
Removes a RangeChangeListener.


getRangeChangeListeners

public RangeChangeListener[] getRangeChangeListeners()
Retrieves all RangeChangeListeners


saveState

public Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class UIXCollection

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class UIXCollection

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Description copied from class: UIXTree
Delivers an event.

Overrides:
broadcast in class UIXTree
Parameters:
event - a FacesEvent
Throws:
javax.faces.event.AbortProcessingException

getStamps

protected final List<javax.faces.component.UIComponent> getStamps()
Gets the stamps. This returns the children of this component plus the nodeStamp stamp (if any).

Overrides:
getStamps in class UIXHierarchy
Returns:
each element must be of type UIComponent.

restoreStampState

protected final void restoreStampState(javax.faces.context.FacesContext context,
                                       javax.faces.component.UIComponent stamp,
                                       Object stampState)
Restores the state for the given stamp. This method avoids changing the state of facets on columns.

Overrides:
restoreStampState in class UIXCollection

saveStampState

protected final Object saveStampState(javax.faces.context.FacesContext context,
                                      javax.faces.component.UIComponent stamp)
Saves the state for the given stamp. This method avoids changing the state of facets on columns.

Overrides:
saveStampState in class UIXCollection
Returns:
this object must be Serializable if client-side state saving is used.

processFacetsAndChildren

protected void processFacetsAndChildren(javax.faces.context.FacesContext context,
                                        javax.faces.event.PhaseId phaseId)
Description copied from class: UIXCollection
Process this component's facets and children. This method should call UIXCollection.processComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent, javax.faces.event.PhaseId) as many times as necessary for each facet and child. UIXCollection.processComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent, javax.faces.event.PhaseId) may be called repeatedly for the same child if that child is being stamped.

Overrides:
processFacetsAndChildren in class UIXTree

visitChildren

protected boolean visitChildren(javax.faces.component.visit.VisitContext visitContext,
                                javax.faces.component.visit.VisitCallback callback)
Description copied from class: UIXCollection

Override default children visiting code to visit the facets and facets of the columns before delegating to the visitData to visit the individual rows of data.

Subclasses should override this method if they wish to change the way in which the non-stamped children are visited. If they wish to change the wash the the stamped children are visited, they should override visitData instead.

Overrides:
visitChildren in class UIXTree
Parameters:
visitContext - the VisitContext for this visit
callback - the VisitCallback instance
Returns:
true if all of the children to visit have been visited
See Also:
UIXCollection.visitData(javax.faces.component.visit.VisitContext, javax.faces.component.visit.VisitCallback)

visitUnstampedFacets

protected boolean visitUnstampedFacets(javax.faces.component.visit.VisitContext visitContext,
                                       javax.faces.component.visit.VisitCallback callback)
Description copied from class: UIXCollection
Hook method for subclasses to override to change the behavior of how unstamped facets of the UIXCollection are visited. The Default implementation visits all of the facets of the UIXCollection.

Overrides:
visitUnstampedFacets in class UIXCollection

visitData

protected boolean visitData(javax.faces.component.visit.VisitContext visitContext,
                            javax.faces.component.visit.VisitCallback callback)
Description copied from class: UIXCollection
Visit the rows and children of the columns of the collection per row-index. This should not visit row index -1 (it will be perfomed in the visitTree method). The columns themselves should not be visited, only their children in this function.

Overrides:
visitData in class UIXTree
Parameters:
visitContext - The visiting context
callback - The visit callback
Returns:
true if the visiting should stop
See Also:
UIXCollection.visitChildren(VisitContext, VisitCallback)

isRootNodeRendered

public final boolean isRootNodeRendered()
Gets If the root node should be rendered or not. Defaults to true.

Returns:
the new rootNodeRendered value

setRootNodeRendered

public final void setRootNodeRendered(boolean rootNodeRendered)
Sets If the root node should be rendered or not. Defaults to true.

Parameters:
rootNodeRendered - the new rootNodeRendered value

getRowsByDepth

public final int[] getRowsByDepth()
Gets the maximum number of records that can be displayed at one time (range size). Each level of depth in the tree can have a different range size. The first number in the array sets the range size for the root collection. Each subsequent number sets the range size for the corresponding depth. The last number becomes the default for each subsequent level of depth. If a node has more children than the range size, navigation rows will be rendered above and below the child nodes.

Returns:
the new rowsByDepth value

setRowsByDepth

public final void setRowsByDepth(int[] rowsByDepth)
Sets the maximum number of records that can be displayed at one time (range size). Each level of depth in the tree can have a different range size. The first number in the array sets the range size for the root collection. Each subsequent number sets the range size for the corresponding depth. The last number becomes the default for each subsequent level of depth. If a node has more children than the range size, navigation rows will be rendered above and below the child nodes.

Parameters:
rowsByDepth - the new rowsByDepth value

getRangeChangeListener

public final javax.el.MethodExpression getRangeChangeListener()
Gets a method reference to a rangeChange listener that will be called when a new range is selected.

Returns:
the new rangeChangeListener value

setRangeChangeListener

public final void setRangeChangeListener(javax.el.MethodExpression rangeChangeListener)
Sets a method reference to a rangeChange listener that will be called when a new range is selected.

Parameters:
rangeChangeListener - the new rangeChangeListener value

getFamily

public String getFamily()
Overrides:
getFamily in class UIXTree

getBeanType

protected FacesBean.Type getBeanType()
Overrides:
getBeanType in class UIXTree


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.