|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
javax.faces.component.UIComponent
org.apache.myfaces.trinidad.component.UIXComponent
org.apache.myfaces.trinidad.component.UIXComponentBase
org.apache.myfaces.trinidad.component.UIXCollection
@JSFComponent
public abstract class UIXCollection
Base class for components that do stamping. This class set the EL 'var' variable correctly when the rowData changes. And it wraps events that are queued, so that the correct rowData can be restored on this component when the event is broadcast.
| Nested Class Summary | |
|---|---|
protected static class |
UIXCollection.NoColumnFacetsVisitContextVisitContext implementation that doesn't visit any of the Facets of UIXColumn children. |
| Field Summary | |
|---|---|
static FacesBean.Type |
TYPE |
static PropertyKey |
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 |
|---|
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 | |
|---|---|
protected |
UIXCollection() |
protected |
UIXCollection(String rendererType) |
| Method Summary | |
|---|---|
boolean |
areRowsAvailable(int rowCount)Check if a range of rows is available starting from the current position |
boolean |
areRowsAvailable(int startIndex, int rowCount)Check if a range of rows is available from a starting index without requiring the client to iterate over the rows |
boolean |
areRowsAvailable(Object startRowKey, int rowCount)Check if a range of rows is available from a starting row key without requiring the client to iterate over the rows |
boolean |
areRowsLocallyAvailable(int rowCount)Check if a range of rows is locally available starting from current position |
boolean |
areRowsLocallyAvailable(int startIndex, int rowCount)Check if a range of rows is locally available starting from a row index |
boolean |
areRowsLocallyAvailable(Object startRowKey, int rowCount)Check if a range of rows is locally available starting from a row key |
void |
broadcast(javax.faces.event.FacesEvent event)Delivers a wrapped event to the appropriate component. |
void |
clearCachedRow(int index)Clear a row from the local cache by row index |
void |
clearCachedRow(Object rowKey)Clear a row from the local cache by row key |
void |
clearCachedRows(int startingIndex, int rowsToClear)Clear the requested range of rows from the local cache |
void |
clearCachedRows(Object startingRowKey, int rowsToClear)Clear the requested range of rows from the local cache |
protected void |
clearCurrencyStringCache()Deprecated. Have your Renderer implement ClientRowKeyManagerFactory and create your own ClientRowKeyManager instances. Then you can manage the lifecycle of each key inside your ClientRowKeyManager. |
void |
clearLocalCache()clear all rows from the local cache |
protected abstract CollectionModel |
createCollectionModel(CollectionModel current, Object value)Creates the CollectionModel to use with this component. |
protected Map<String,Object> |
createVarStatusMap()Gets the Map to use as the "varStatus". |
protected void |
decodeChildrenImpl(javax.faces.context.FacesContext context)Calls processDecodes on all facets and children of this component. |
protected boolean |
defaultVisitChildren(javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback callback)Default implementation of child visiting of UIXCollection subclasses for cases where a UIXCollection subclass wants to restore the default implementation that one of its superclasses have overridden. |
void |
encodeBegin(javax.faces.context.FacesContext context)Clears all the currency strings. |
void |
encodeEnd(javax.faces.context.FacesContext context) |
void |
ensureRowsAvailable(int rowCount)Ensure that the model has at least rowCount number of rows. |
LocalRowKeyIndex.LocalCachingStrategy |
getCachingStrategy()Indicates the caching strategy supported by the model |
String |
getClientRowKey()Gets a String version of the current rowkey. |
ClientRowKeyManager |
getClientRowKeyManager()Gets the ClientRowKeyManager that is used to handle the getClientRowKey() and setClientRowKey(java.lang.String) methods. |
protected CollectionModel |
getCollectionModel()Gets the CollectionModel to use with this component. |
protected CollectionModel |
getCollectionModel(boolean createIfNull)Gets the CollectionModel to use with this component. |
String |
getContainerClientId(javax.faces.context.FacesContext context)Gets the client-id of this component, without any NamingContainers. |
String |
getCurrencyString()Deprecated. use getClientRowKey |
int |
getEstimatedRowCount()Convenient API to return a row count estimate. |
LocalRowKeyIndex.Confidence |
getEstimatedRowCountConfidence()Helper API to determine if the row count returned from getEstimatedRowCount() is EXACT, or an ESTIMATE |
int |
getRowCount()Gets the total number of rows in this table. |
Object |
getRowData()Gets the data for the current row. |
Object |
getRowData(int rowIndex)Gets the rowData at the given index. |
Object |
getRowData(Object rowKey)Get row data by row key. |
int |
getRowIndex()Gets the index of the current row. |
Object |
getRowKey()Gets the rowKey of the current row. |
List<SortCriterion> |
getSortCriteria()Gets the criteria that this collection is sorted by. |
protected List<javax.faces.component.UIComponent> |
getStamps()Gets the UIComponents that are considered stamps. |
protected abstract Object |
getValue()Gets the value that must be converted into a CollectionModel |
String |
getVar()Gets the name of the EL variable used to reference each element of this collection. |
abstract String |
getVarStatus()Gets the EL variable name to use to expose the varStatusMap. |
boolean |
invokeOnComponent(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback)Override to calls the hooks for setting up and tearing down the context before the children are visited. |
boolean |
isRowAvailable()Checks to see if the current row is available. |
boolean |
isRowAvailable(int rowIndex)Checks to see if the row at the given index is available. |
boolean |
isRowAvailable(Object rowKey)Check for an available row by row key. |
boolean |
isRowLocallyAvailable(int rowIndex)Given a row index, check if a row is locally available |
boolean |
isRowLocallyAvailable(Object rowKey)Given a row key, check if a row is locally available |
boolean |
isSortable(String property) |
protected void |
postCreateCollectionModel(CollectionModel model)Hook called with the result of createCollectionModel. |
protected void |
postRowDataChange()Sets up this component to use the new rowData. |
protected void |
preRowDataChange()Prepares this component for a change in the rowData. |
protected void |
processComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.event.PhaseId phaseId)Process a component. |
void |
processDecodes(javax.faces.context.FacesContext context)Decodes this component before decoding the facets. |
void |
processEvent(javax.faces.event.ComponentSystemEvent event) |
protected abstract void |
processFacetsAndChildren(javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId)Process this component's facets and children. |
void |
processRestoreState(javax.faces.context.FacesContext context, Object state) |
Object |
processSaveState(javax.faces.context.FacesContext context) |
void |
processUpdates(javax.faces.context.FacesContext context) |
void |
processValidators(javax.faces.context.FacesContext context) |
void |
queueEvent(javax.faces.event.FacesEvent event)Queues an event. |
void |
resetStampState()Resets this component's stamps to their uninitialized state. |
protected void |
restoreStampState(javax.faces.context.FacesContext context, javax.faces.component.UIComponent stamp, Object stampState)Restores the state of a 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 of a stamp. |
Object |
saveState(javax.faces.context.FacesContext context) |
void |
setClientRowKey(String clientRowKey)Restores this component's rowData to be what it was when the given client rowKey string was created. |
void |
setCurrencyString(String currency)Deprecated. use setClientRowKey |
void |
setRowIndex(int rowIndex)Makes a row current. |
void |
setRowKey(Object rowKey)Makes a row current. |
void |
setSortCriteria(List<SortCriterion> criteria)Sorts this collection by the given criteria. |
protected Object |
setupELVariable(javax.faces.context.FacesContext context, String name, Object value)Called by UIXCollection to set values for the "var" and "varStatus" EL variables. |
protected void |
setupVisitingContext(javax.faces.context.FacesContext context)Sets up the context necessary to visit or invoke the component for all phases. |
void |
setVar(String var)Sets the name of the EL variable used to reference each element of this collection. |
protected void |
tearDownVisitingContext(javax.faces.context.FacesContext context)Tears down context created in order to visit or invoke the component for all phases. |
protected void |
updateChildrenImpl(javax.faces.context.FacesContext context) |
protected void |
validateChildrenImpl(javax.faces.context.FacesContext context)Calls processValidators on all facets and children of this component. |
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 |
visitChildrenWithoutIterating(javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback callback)Performs a non-iterating visit of the children. |
protected abstract 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 javax.faces.component.UIComponent |
|---|
encodeAll, getClientId, getCompositeComponentParent, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getResourceBundleMap, getTransientStateHelper, getTransientStateHelper, isCompositeComponent, isInView, popComponentFromEL, pushComponentToEL, restoreTransientState, saveTransientState, setInView |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final FacesBean.Type TYPE
public static final PropertyKey VAR_KEY
| Constructor Detail |
|---|
protected UIXCollection(String rendererType)
protected UIXCollection()
| Method Detail |
|---|
public final String getVar()
public final void setVar(String var)
public void queueEvent(javax.faces.event.FacesEvent event)
queueEvent in class UIXComponentBaseevent - a FacesEvent
public void broadcast(javax.faces.event.FacesEvent event)
throws javax.faces.event.AbortProcessingException
broadcast in class UIXComponentBaseevent - a FacesEventjavax.faces.event.AbortProcessingExceptionpublic final void processDecodes(javax.faces.context.FacesContext context)
processDecodes in class UIXComponentBasecontext - the FacesContextprotected void decodeChildrenImpl(javax.faces.context.FacesContext context)
UIXComponentBasedecodeChildrenImpl in class UIXComponentBasecontext - the current FacesContextprotected void validateChildrenImpl(javax.faces.context.FacesContext context)
UIXComponentBasevalidateChildrenImpl in class UIXComponentBasecontext - the current FacesContextprotected void updateChildrenImpl(javax.faces.context.FacesContext context)
updateChildrenImpl in class UIXComponentBasepublic void resetStampState()
public Object processSaveState(javax.faces.context.FacesContext context)
processSaveState in class UIXComponentBasepublic Object saveState(javax.faces.context.FacesContext context)
saveState in interface javax.faces.component.StateHoldersaveState in class UIXComponentBase
public void restoreState(javax.faces.context.FacesContext context,
Object state)
restoreState in interface javax.faces.component.StateHolderrestoreState in class UIXComponentBasepublic final boolean isRowAvailable()
DataModel.isRowAvailable()public final boolean isRowAvailable(Object rowKey)
rowKey - the row key for the row to check.public final Object getRowData(Object rowKey)
rowKey - the row key for the row to get data.public final boolean areRowsAvailable(int rowCount)
rowCount - number of rows to check
public final boolean areRowsAvailable(int startIndex,
int rowCount)
startIndex - the starting index for the rangerowCount - number of rows to check
public final boolean areRowsAvailable(Object startRowKey,
int rowCount)
startRowKey - the starting row key for the rangerowCount - number of rows to checkpublic final int getRowCount()
DataModel.getRowCount()public final int getRowIndex()
DataModel.getRowIndex()public final Object getRowKey()
CollectionModel.getRowKey()public final Object getRowData()
CollectionModel.getRowData(int)public boolean isRowAvailable(int rowIndex)
rowIndex - the index of the row to check.CollectionModel.isRowAvailable(int)public Object getRowData(int rowIndex)
rowIndex - the index of the row to get data from.CollectionModel.getRowData(int)public abstract String getVarStatus()
createVarStatusMap()public void setRowKey(Object rowKey)
preRowDataChange() and postRowDataChange() as appropriate.rowKey - The rowKey of the row that should be made current. Use null to clear the current row.CollectionModel.setRowKey(java.lang.Object)public void setRowIndex(int rowIndex)
preRowDataChange() and postRowDataChange() as appropriate.rowIndex - The rowIndex of the row that should be made current. Use -1 to clear the current row.DataModel.setRowIndex(int)public final boolean isSortable(String property)
property - a property name in the modelCollectionModel.isSortable(java.lang.String)public void setSortCriteria(List<SortCriterion> criteria)
criteria - Each element in this List must be of type SortCriterion.SortCriterion, CollectionModel.setSortCriteria(java.util.List<org.apache.myfaces.trinidad.model.SortCriterion>)public final List<SortCriterion> getSortCriteria()
SortCriterion, CollectionModel.getSortCriteria()
@Deprecated
protected void clearCurrencyStringCache()
ClientRowKeyManagerFactory and create your own ClientRowKeyManager instances. Then you can manage the lifecycle of each key inside your ClientRowKeyManager.encodeBegin(FacesContext) is called.
public final void encodeBegin(javax.faces.context.FacesContext context)
throws IOException
encodeBegin in class UIXComponentBaseIOException
public void encodeEnd(javax.faces.context.FacesContext context)
throws IOException
encodeEnd in class UIXComponentBaseIOExceptionprotected void setupVisitingContext(javax.faces.context.FacesContext context)
UIXComponentSets up the context necessary to visit or invoke the component for all phases.
The default implementation does nothing.
If a subclass overrides this method, it should override tearDownVisitingContext as well.
It is guaranteed that if setupVisitingContext completes tearDownVisitingContext will be called for this component
setupVisitingContext in class UIXComponentcontext - FacesContextUIXComponent.tearDownVisitingContext(javax.faces.context.FacesContext), UIXComponent.setupEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext), UIXComponent.tearDownEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext), #setupChildrenVistingContextprotected void tearDownVisitingContext(javax.faces.context.FacesContext context)
UIXComponentTears down context created in order to visit or invoke the component for all phases.
The default implementation does nothing.
A subclass should only override this method if it overrode setupVisitingContext as well
It is guaranteed that tearDownVisitingContext will be called only after setupVisitingContext has been called for this component
tearDownVisitingContext in class UIXComponentcontext - FacesContextUIXComponent.setupVisitingContext(javax.faces.context.FacesContext), UIXComponent.setupEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext), UIXComponent.tearDownEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext)
@Deprecated
public String getCurrencyString()
getClientRowKey()
@Deprecated
public void setCurrencyString(String currency)
setClientRowKey(java.lang.String)public String getClientRowKey()
ClientRowKeyManager. This String can be passed into the setClientRowKey(java.lang.String) method to restore the current rowData. The lifetime of this String is short and it may not be valid during future requests; however, it is guaranteed to be valid for the next subsequent request.setClientRowKey(java.lang.String), getClientRowKeyManager(), ClientRowKeyManager.getClientRowKey(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)public void setClientRowKey(String clientRowKey)
getClientRowKey()
public void processRestoreState(javax.faces.context.FacesContext context,
Object state)
processRestoreState in class UIXComponentBasepublic void processUpdates(javax.faces.context.FacesContext context)
processUpdates in class UIXComponentBasepublic void processValidators(javax.faces.context.FacesContext context)
processValidators in class UIXComponentBase
public void processEvent(javax.faces.event.ComponentSystemEvent event)
throws javax.faces.event.AbortProcessingException
processEvent in interface javax.faces.event.ComponentSystemEventListenerprocessEvent in class javax.faces.component.UIComponentjavax.faces.event.AbortProcessingExceptionpublic final String getContainerClientId(javax.faces.context.FacesContext context)
getContainerClientId in class javax.faces.component.UIComponentgetClientRowKey()protected final void preRowDataChange()
protected final void postRowDataChange()
protected List<javax.faces.component.UIComponent> getStamps()
protected Object saveStampState(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent stamp)
protected void restoreStampState(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent stamp,
Object stampState)
protected final void processComponent(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
javax.faces.event.PhaseId phaseId)
processDecodes(FacesContext), processValidators(javax.faces.context.FacesContext) or processUpdates(javax.faces.context.FacesContext) depending on the {#link PhaseId}.
protected abstract void processFacetsAndChildren(javax.faces.context.FacesContext context,
javax.faces.event.PhaseId phaseId)
processComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent, javax.faces.event.PhaseId) as many times as necessary for each facet and child. 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.protected final CollectionModel getCollectionModel()
public final ClientRowKeyManager getClientRowKeyManager()
getClientRowKey() and setClientRowKey(java.lang.String) methods. If the manager does not already exist a new one is created. In order to create your own manager, your Renderer (for this component) must implement ClientRowKeyManagerFactory
public boolean invokeOnComponent(javax.faces.context.FacesContext context,
String clientId,
javax.faces.component.ContextCallback callback)
throws javax.faces.FacesException
UIXComponentBaseinvokeOnComponent in class UIXComponentBasejavax.faces.FacesExceptionUIXComponent.setupVisitingContext(javax.faces.context.FacesContext), UIXComponent.tearDownVisitingContext(javax.faces.context.FacesContext)
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.
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.
visitChildren in class UIXComponentvisitContext -callback -true if all of the children to visit have been visitedvisitData(javax.faces.component.visit.VisitContext, javax.faces.component.visit.VisitCallback)
protected boolean visitChildrenWithoutIterating(javax.faces.component.visit.VisitContext visitContext,
javax.faces.component.visit.VisitCallback callback)
visitContext -callback -
protected final boolean defaultVisitChildren(javax.faces.component.visit.VisitContext visitContext,
javax.faces.component.visit.VisitCallback callback)
visitContext -callback -
protected boolean visitUnstampedFacets(javax.faces.component.visit.VisitContext visitContext,
javax.faces.component.visit.VisitCallback callback)
protected abstract boolean visitData(javax.faces.component.visit.VisitContext visitContext,
javax.faces.component.visit.VisitCallback callback)
visitContext - The visiting contextcallback - The visit callbackvisitChildren(VisitContext, VisitCallback)protected final CollectionModel getCollectionModel(boolean createIfNull)
createIfNull - creates the collection model if necessary
protected abstract CollectionModel createCollectionModel(CollectionModel current,
Object value)
postCreateCollectionModelcurrent - the current CollectionModel, or null if there is none.value - this is the value returned from getValue()postCreateCollectionModel(org.apache.myfaces.trinidad.model.CollectionModel)protected void postCreateCollectionModel(CollectionModel model)
createCollectionModel. Subclasses can use this method to perform initialization after the CollectionModel is fully initialized. Subclassers should call super before accessing any component state to ensure that superclass initialization has been performed.model - The model instance returned by<createCollectionModelcreateCollectionModel(org.apache.myfaces.trinidad.model.CollectionModel, java.lang.Object)protected abstract Object getValue()
protected Map<String,Object> createVarStatusMap()
public boolean isRowLocallyAvailable(int rowIndex)
rowIndex - index of row to checkpublic boolean isRowLocallyAvailable(Object rowKey)
rowKey - row key for the row to checkpublic boolean areRowsLocallyAvailable(int rowCount)
rowCount - number of rows in the range
public boolean areRowsLocallyAvailable(int startIndex,
int rowCount)
startIndex - staring index for the rangerowCount - number of rows in the range
public boolean areRowsLocallyAvailable(Object startRowKey,
int rowCount)
startRowKey - staring row key for the rangerowCount - number of rows in the rangepublic int getEstimatedRowCount()
public LocalRowKeyIndex.Confidence getEstimatedRowCountConfidence()
getEstimatedRowCount() is EXACT, or an ESTIMATEpublic void clearLocalCache()
public void clearCachedRows(int startingIndex,
int rowsToClear)
startingIndex - starting row index for the range to clearrowsToClear - number of rows to clear from the cache
public void clearCachedRows(Object startingRowKey,
int rowsToClear)
startingRowKey - starting row key for the range to clearrowsToClear - number of rows to clear from the cachepublic void clearCachedRow(int index)
index - row index for the row to clear from the cachepublic void clearCachedRow(Object rowKey)
rowKey - row key for the row to clear from the cachepublic LocalRowKeyIndex.LocalCachingStrategy getCachingStrategy()
LocalRowKeyIndex.LocalCachingStrategypublic void ensureRowsAvailable(int rowCount)
rowCount - the number of rows the model should hold.
protected Object setupELVariable(javax.faces.context.FacesContext context,
String name,
Object value)
context - the FacesContext for the current requestname - the non-null name of the EL variablevalue - the value of the EL variable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.