org.apache.myfaces.trinidad.component
Class UIXComponent

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by org.apache.myfaces.trinidad.component.UIXComponent
All Implemented Interfaces:
javax.faces.component.StateHolder
Direct Known Subclasses:
UIXComponentBase

public abstract class UIXComponent
extends javax.faces.component.UIComponent

Pure abstract base class for all UIX components.


Field Summary
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
UIXComponent()
           
 
Method Summary
abstract  void addAttributeChangeListener(AttributeChangeListener acl)
          Adds an AttributeChangeListener.
abstract  javax.el.MethodExpression getAttributeChangeListener()
          Gets the method binding to an AttributeChangeListener.
abstract  AttributeChangeListener[] getAttributeChangeListeners()
          Gets the registered AttributeChangeListeners.
abstract  java.lang.String getContainerClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent child)
          Provides additional context (the target child component for which the container client ID is requested) to a naming container for constructing a client ID.
abstract  FacesBean getFacesBean()
          Returns the FacesBean used for storing the component's state.
protected  boolean isVisitable(VisitContext visitContext)
          Called by UIXComponent.visitTree() to determine whether this component is "visitable" - ie. whether this component satisfies the org.apache.myfaces.trinidad.component.visit.VisitHints returned by VisitContext.getHints().
abstract  void markInitialState()
           
 VisitResult partialEncodeVisit(VisitContext visitContext, PartialPageContext partialContext, VisitCallback callback)
           Called when visiting the component during optimized partial page encoding so that the component can modify what is actually encoded.
static
<S> boolean
processFlattenedChildren(javax.faces.context.FacesContext context, ComponentProcessingContext cpContext, ComponentProcessor<S> childProcessor, java.lang.Iterable<javax.faces.component.UIComponent> children, S callbackContext)
          Helper function called by FlattenedComponents to iterate over a flattened view of their children, potentially themselves FlattenedComponents, invoking the childProcessor with its callbackContext on each renderable instance.
static
<S> boolean
processFlattenedChildren(javax.faces.context.FacesContext context, ComponentProcessingContext cpContext, ComponentProcessor<S> childProcessor, javax.faces.component.UIComponent child, S callbackContext)
          Helper function called by FlattenedComponent to iterate over a flattened view of a group of potentially FlattenedComponent instances rooted at a single child of the FlattenedComponent, invoking the childProcessor with its callbackContext on each renderable instance.
static
<S> boolean
processFlattenedChildren(javax.faces.context.FacesContext context, ComponentProcessor<S> childProcessor, java.lang.Iterable<javax.faces.component.UIComponent> children, S callbackContext)
          Helper function called by Renderers to iterate over a flattened view of the children, potentially containing FlattenedComponents, of the component the Renderer is encoding, invoking the childProcessor with its callbackContext on each renderable instance.
static
<S> boolean
processFlattenedChildren(javax.faces.context.FacesContext context, ComponentProcessor<S> childProcessor, javax.faces.component.UIComponent child, S callbackContext)
          Helper function called by Renderers to iterate over a flattened view of a group of potentially FlattenedComponent instances rooted at a single child of the component that the Renderer is encoding, invoking the childProcessor with its callbackContext on each renderable instance.
abstract  void removeAttributeChangeListener(AttributeChangeListener acl)
          Removes an AttributeChangeListener.
abstract  void setAttributeChangeListener(javax.el.MethodExpression me)
          Sets a method binding to an AttributeChangeListener.
protected  void setUpEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc)
          Sets up the context necessary to encode the component.
protected  void setupVisitingContext(javax.faces.context.FacesContext context)
          Sets up the context necessary to visit or invoke the component for all phases.
protected  void tearDownEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc)
          Tears down the context created in order to encode the component The default implementation delegates to CoreRenderer.tearDownEncodingContext and then calls tearDownVisitingContext A subclass should only override this method if it overrode setUpEncodingContext as well It is guaranteed that tearDownEncodingContext will be called only after setUpEncodingContext has been called for this component
protected  void tearDownVisitingContext(javax.faces.context.FacesContext context)
          Tears down context created in order to visit or invoke the component for all phases.
static boolean visitTree(VisitContext visitContext, javax.faces.component.UIComponent component, VisitCallback callback)
          Perform a tree visit starting at the specified node in the tree.
 boolean visitTree(VisitContext visitContext, VisitCallback callback)
          Perform a tree visit starting at this node in the tree.
 
Methods inherited from class javax.faces.component.UIComponent
addFacesListener, broadcast, decode, encodeAll, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getContainerClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getFamily, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, setId, setParent, setRendered, setRendererType, setValueBinding, setValueExpression
 
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.StateHolder
isTransient, restoreState, saveState, setTransient
 

Constructor Detail

UIXComponent

public UIXComponent()
Method Detail

processFlattenedChildren

public static <S> boolean processFlattenedChildren(javax.faces.context.FacesContext context,
                                                   ComponentProcessor<S> childProcessor,
                                                   javax.faces.component.UIComponent child,
                                                   S callbackContext)
                                        throws java.io.IOException
Helper function called by Renderers to iterate over a flattened view of a group of potentially FlattenedComponent instances rooted at a single child of the component that the Renderer is encoding, invoking the childProcessor with its callbackContext on each renderable instance.

If the child is a FlattenedComponent, the childProcessor will be called on each of that FlattenedComponent's children, recursing if those children are themselves FlattenedComponents, otherwise, the childProcessor will be called on the child itself.

This method is typically used to flatten the contents of a facet on the FlattenedComponent to be encoded. If the Renderer accidentally passes in the component to be encoded instead of one of its children, the result will almost certainly be an infinite recursion and stack overflow.

Throws:
java.io.IOException
See Also:
processFlattenedChildren(FacesContext, ComponentProcessor, Iterable, Object), processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, UIComponent, Object), processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, Iterable, Object), FlattenedComponent

processFlattenedChildren

public static <S> boolean processFlattenedChildren(javax.faces.context.FacesContext context,
                                                   ComponentProcessingContext cpContext,
                                                   ComponentProcessor<S> childProcessor,
                                                   javax.faces.component.UIComponent child,
                                                   S callbackContext)
                                        throws java.io.IOException
Helper function called by FlattenedComponent to iterate over a flattened view of a group of potentially FlattenedComponent instances rooted at a single child of the FlattenedComponent, invoking the childProcessor with its callbackContext on each renderable instance.

If the child is a FlattenedComponent, the childProcessor will be called on each of that FlattenedComponent's children, recursing if those children are themselves FlattenedComponents, otherwise, the childProcessor will be called on the child itself.

This method is typically used to flatten the contents of a facet of the FlattenedComponent. If the FlattenedComponent accidentally passes in itself instead of one of its children, the result will almost certainly be an infinite recursion and stack overflow.

Throws:
java.io.IOException
See Also:
processFlattenedChildren(FacesContext, ComponentProcessor, UIComponent, Object), processFlattenedChildren(FacesContext, ComponentProcessor, Iterable, Object), processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, Iterable, Object), FlattenedComponent

processFlattenedChildren

public static <S> boolean processFlattenedChildren(javax.faces.context.FacesContext context,
                                                   ComponentProcessor<S> childProcessor,
                                                   java.lang.Iterable<javax.faces.component.UIComponent> children,
                                                   S callbackContext)
                                        throws java.io.IOException
Helper function called by Renderers to iterate over a flattened view of the children, potentially containing FlattenedComponents, of the component the Renderer is encoding, invoking the childProcessor with its callbackContext on each renderable instance.

For each FlattenedComponent child, the childProcessor will be called on each of that FlattenedComponent's children, recursing if those children are themselves FlattenedComponents, otherwise, the childProcessor will be called on the child itself.

This method is typically used to flatten the children of the FlattenedComponent to be encoded.

Throws:
java.io.IOException
See Also:
processFlattenedChildren(FacesContext, ComponentProcessor, UIComponent, Object), processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, UIComponent, Object), processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, Iterable, Object), FlattenedComponent

processFlattenedChildren

public static <S> boolean processFlattenedChildren(javax.faces.context.FacesContext context,
                                                   ComponentProcessingContext cpContext,
                                                   ComponentProcessor<S> childProcessor,
                                                   java.lang.Iterable<javax.faces.component.UIComponent> children,
                                                   S callbackContext)
                                        throws java.io.IOException
Helper function called by FlattenedComponents to iterate over a flattened view of their children, potentially themselves FlattenedComponents, invoking the childProcessor with its callbackContext on each renderable instance.

For each FlattenedComponent child, the childProcessor will be called on each of that FlattenedComponent's children, recursing if those children are themselves FlattenedComponents, otherwise, the childProcessor will be called on the child itself.

Throws:
java.io.IOException
See Also:
processFlattenedChildren(FacesContext, ComponentProcessor, UIComponent, Object), processFlattenedChildren(FacesContext, ComponentProcessor, Iterable, Object), processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, UIComponent, Object), FlattenedComponent

visitTree

public boolean visitTree(VisitContext visitContext,
                         VisitCallback callback)

Perform a tree visit starting at this node in the tree.

UIXComponent.visitTree() implementations do not invoke the VisitCallback directly, but instead call VisitContext.invokeVisitCallback() to invoke the callback. This allows VisitContext implementations to provide optimized tree traversals, for example by only calling the VisitCallback for a subset of components.

Parameters:
visitContext - the VisitContext for this visit
callback - the VisitCallback instance whose visit method will be called for each node visited.
Returns:
component implementations may return true to indicate that the tree visit is complete (eg. all components that need to be visited have been visited). This results in the tree visit being short-circuited such that no more components are visited.
See Also:
VisitContext.invokeVisitCallback()

visitTree

public static boolean visitTree(VisitContext visitContext,
                                javax.faces.component.UIComponent component,
                                VisitCallback callback)

Perform a tree visit starting at the specified node in the tree.

UIXComponent.visitTree() implementations do not invoke the VisitCallback directly, but instead call VisitContext.invokeVisitCallback() to invoke the callback. This allows VisitContext implementations to provide optimized tree traversals, for example by only calling the VisitCallback for a subset of components.

Parameters:
visitContext - the VisitContext for this visit
component - the UIComponent to start the visit from
callback - the VisitCallback instance whose visit method will be called for each node visited.
Returns:
component implementations may return true to indicate that the tree visit is complete (eg. all components that need to be visited have been visited). This results in the tree visit being short-circuited such that no more components are visited.
See Also:
VisitContext.invokeVisitCallback()

isVisitable

protected boolean isVisitable(VisitContext visitContext)

Called by UIXComponent.visitTree() to determine whether this component is "visitable" - ie. whether this component satisfies the org.apache.myfaces.trinidad.component.visit.VisitHints returned by VisitContext.getHints().

If this component is not visitable (ie. if this method returns false), the tree visited is short-circuited such that neither the component nor any of its descendents will be visited>

Custom treeVisit() implementations may call this method to determine whether the component is visitable before performing any visit-related processing.

Returns:
true if this component should be visited, false otherwise.

partialEncodeVisit

public VisitResult partialEncodeVisit(VisitContext visitContext,
                                      PartialPageContext partialContext,
                                      VisitCallback callback)

Called when visiting the component during optimized partial page encoding so that the component can modify what is actually encoded. For example tab controls often render the tabs for the ShowDetailItems in the tab bar before delegating to the disclosed ShowDetailItem to render the tab content. As a result, the tab control needs to encode its tab bar if any of its ShowDetailItems are partial targets so that the tab labels, for example, are up-to-date.

The default implementation delegates to the CoreRenderer if this component has one, otherwise it calls the VisitCallback and returns its result if this UIXComponent is a partial target of the current encoding.

Parameters:
visitContext - VisitContext to pass to the VisitCallback
partialContext - PartialPageContext for the current partial encoding
callback - VisitCallback to call if this component is a partial target
Returns:
The VisitResult controlling continued iteration of the visit.

setupVisitingContext

protected void setupVisitingContext(javax.faces.context.FacesContext context)

Sets 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

See Also:
tearDownVisitingContext(javax.faces.context.FacesContext), setUpEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext), tearDownEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext)

tearDownVisitingContext

protected void tearDownVisitingContext(javax.faces.context.FacesContext context)

Tears 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

See Also:
setupVisitingContext(javax.faces.context.FacesContext), setUpEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext), tearDownEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext)

setUpEncodingContext

protected void setUpEncodingContext(javax.faces.context.FacesContext context,
                                    RenderingContext rc)

Sets up the context necessary to encode the component.

The default implementation delegates to CoreRenderer.setupEncodingContext and then calls setupVisitingContext

If a subclass overrides this method, it should override tearDownEncodingContext as well.

It is guaranteed that if setUpEncodingContext completes tearDownEncodingContext will be called for this component

See Also:
setupVisitingContext(javax.faces.context.FacesContext), tearDownVisitingContext(javax.faces.context.FacesContext), tearDownEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext), CoreRenderer.setupEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext, org.apache.myfaces.trinidad.component.UIXComponent)

tearDownEncodingContext

protected void tearDownEncodingContext(javax.faces.context.FacesContext context,
                                       RenderingContext rc)

Tears down the context created in order to encode the component

The default implementation delegates to CoreRenderer.tearDownEncodingContext and then calls tearDownVisitingContext

A subclass should only override this method if it overrode setUpEncodingContext as well

It is guaranteed that tearDownEncodingContext will be called only after setUpEncodingContext has been called for this component

See Also:
setUpEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext), tearDownVisitingContext(javax.faces.context.FacesContext), setUpEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext), CoreRenderer.tearDownEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext, org.apache.myfaces.trinidad.component.UIXComponent)

getFacesBean

public abstract FacesBean getFacesBean()
Returns the FacesBean used for storing the component's state.


addAttributeChangeListener

public abstract void addAttributeChangeListener(AttributeChangeListener acl)
Adds an AttributeChangeListener. 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 events might include the width of a column that supported client-side resizing.


removeAttributeChangeListener

public abstract void removeAttributeChangeListener(AttributeChangeListener acl)
Removes an AttributeChangeListener. 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 events might include the width of a column that supported client-side resizing.


getAttributeChangeListeners

public abstract AttributeChangeListener[] getAttributeChangeListeners()
Gets the registered AttributeChangeListeners.


setAttributeChangeListener

public abstract void setAttributeChangeListener(javax.el.MethodExpression me)
Sets a method binding to an AttributeChangeListener. 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 events might include the width of a column that supported client-side resizing.


getAttributeChangeListener

public abstract javax.el.MethodExpression getAttributeChangeListener()
Gets the method binding to an AttributeChangeListener. 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 events might include the width of a column that supported client-side resizing.


markInitialState

public abstract void markInitialState()

getContainerClientId

public abstract java.lang.String getContainerClientId(javax.faces.context.FacesContext context,
                                                      javax.faces.component.UIComponent child)
Provides additional context (the target child component for which the container client ID is requested) to a naming container for constructing a client ID. This is useful for components such as @link UIXTable and @link UIXTreeTable which need to return different container client IDs for stamped and non-stamped child components.

See Also:
UIXComponentBase.getClientId(FacesContext context)


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