|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FlattenedComponent
Interface implemented by Components that don't render any content themselves but rather set up context before asking their children to render themselves. Implementing this interface enables Renderers for components that contain instances of the FlattenedComponents to visit each descendant in a flattened view of their children, recursively including any FlattenedComponent treating all of these descendants as direct children.
A good indicator that a component should implement FlattenedComponent is that the component doesn't delegate to a Renderer, but rather renders itself.
ComponentProcessor
,
UIXComponent.processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, UIComponent, Object)
,
UIXComponent.processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, Iterable, Object)
Method Summary | ||
---|---|---|
boolean |
isFlatteningChildren(javax.faces.context.FacesContext context)
Returns true if this FlattenedComponent is currently flattening its children. |
|
|
processFlattenedChildren(javax.faces.context.FacesContext context,
ComponentProcessingContext cpContext,
ComponentProcessor<S> childProcessor,
S callbackContext)
Set up the component context, process all of the renderable children of this component, and the restore the previous context, returning true if any of the children
were processed. |
Method Detail |
---|
<S> boolean processFlattenedChildren(javax.faces.context.FacesContext context, ComponentProcessingContext cpContext, ComponentProcessor<S> childProcessor, S callbackContext) throws IOException
true
if any of the children
were processed.
The context set up and tear down to perform is identical to that which the component
would perform when handling rendering or implementing invokeOnComponent
To handle actually processing the children, the component will typically delegate to one
of the two UIXComponent.processFlattenedChildren
helpers. If the component only
processes a single child, as UIXSwitcher does, it will call the version taking a single child
as the argument. If it processes all of its children as UIXIterator and UIXGroup do, it
will call getChildren
and pass the List<UIComponent> to the version accepting
an Iterable<UIComponent>.
This method should only be called if FlattenedComponent.isFlatteningChildren
returns true
. If called when FlattenedComponent.isFlatteningChildren
is false
the behavior is undefined and the implementation may throw an
IllegalStateException.
This method may only be called when the FlattenedComponent is in the correct context to process itself.
context
- Current FacesContextcpContext
- ComponentProcesingContext represetning the current child iteration statechildProcessor
- ComponentProcessor to call for each flattened childcallbackContext
- childProcessor-specific context to be passed on each call to the
childProcessor
true
if this FlattenedComponent actually processed any children
IOException
- if an error occurs while processing children
IllegalStateException
- if called when isFlatteningChildren()
is
false
.UIXComponent.processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, UIComponent, Object)
,
UIXComponent.processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, Iterable, Object)
,
isFlatteningChildren(javax.faces.context.FacesContext)
boolean isFlatteningChildren(javax.faces.context.FacesContext context)
true
if this FlattenedComponent is currently flattening its children. This
allows a FlattenedComponent instance to flatten or not flatten its children as it sees fit.
It is illegal to call processFlattenedChildren
on a FlattenedComponent that
has returned false
from isFlatteningChildren
.
context
- FacesContext
true
if this FlattenedComponent is currently flattening its childrenprocessFlattenedChildren(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.component.ComponentProcessingContext, org.apache.myfaces.trinidad.component.ComponentProcessor, S)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |