org.apache.myfaces.trinidadinternal.renderkit.core.ppr
Class PartialPageContextImpl

java.lang.Object
  extended by org.apache.myfaces.trinidad.context.PartialPageContext
      extended by org.apache.myfaces.trinidadinternal.renderkit.core.ppr.PartialPageContextImpl

public class PartialPageContextImpl
extends org.apache.myfaces.trinidad.context.PartialPageContext

Context object which is used to track the targets of a partial page render during the partial page rendering pass. Clients never need to explicitly create PartialPageContext objects.

During the partial rendering pass, some Renderer implementations may modify the set of partial targets that are rendered. (For example, the FormRenderer adds a partial target for its shared hidden fields if any children of the form are rendered.) After the partial render pass, getPartialTargets() can be called to determine the actual set of partial targets that were rendered.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/renderkit/core/ppr/PartialPageContext.java#0 $) $Date: 10-nov-2005.19:02:58 $

Constructor Summary
PartialPageContextImpl(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RequestContext reqContext)
          Creates a PartialPageContext to use to render the partial targets with the specified ids.
 
Method Summary
 void addPartialTarget(java.lang.String clientId)
          Adds a new partial target to render.
 void addRenderedPartialTarget(java.lang.String clientId)
          Adds a partial target that has already been rendered; this is needed if the "clientId" of a component does not match up to the top element (or elements).
 boolean areAllTargetsProcessed()
          Returns true if all of the partial targets have been rendered.
 java.util.Iterator<java.lang.String> getPartialTargets()
          Returns the set of partial targets for this rendering pass.
 java.util.Iterator<java.lang.String> getRenderedPartialTargets()
           
 javax.faces.component.visit.VisitContext getVisitContext()
          Returns the VisitContext to use when partial rendering.
 boolean isInsidePartialTarget()
          Returns true if we are inside of a partial target.
 boolean isPartialTarget(java.lang.String clientId)
          Tests whether the specified id is the client id of a UIComponent that should be rendered as part of the partial rendering pass.
 boolean isPartialTargetRendered(java.lang.String id)
          Tests whether the specified partial target has been rendered.
 boolean isPossiblePartialTarget(java.lang.String componentId)
           Tests whether the specified component id is a component id of a UIComponent that might be rendered in this partial rendering pass.
 void popRenderedPartialTarget()
          Notifies the PartialPageContext that the current partial target has finished rendering.
 void pushRenderedPartialTarget(java.lang.String clientId)
          Notifies the PartialPageContext that the specified partial target is about to be rendered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartialPageContextImpl

public PartialPageContextImpl(javax.faces.context.FacesContext context,
                              org.apache.myfaces.trinidad.context.RequestContext reqContext)
Creates a PartialPageContext to use to render the partial targets with the specified ids.

Method Detail

getPartialTargets

public java.util.Iterator<java.lang.String> getPartialTargets()
Returns the set of partial targets for this rendering pass.

Specified by:
getPartialTargets in class org.apache.myfaces.trinidad.context.PartialPageContext

isPartialTarget

public boolean isPartialTarget(java.lang.String clientId)
Tests whether the specified id is the client id of a UIComponent that should be rendered as part of the partial rendering pass.

Specified by:
isPartialTarget in class org.apache.myfaces.trinidad.context.PartialPageContext

isPossiblePartialTarget

public boolean isPossiblePartialTarget(java.lang.String componentId)

Tests whether the specified component id is a component id of a UIComponent that might be rendered in this partial rendering pass.

As calculating clientIds is expensive, this method allows a cheap test to reject components that shouldn't be rendered. If this method returns true, a more exact test using isPartialTarget with the desired clientId should be performed.

Specified by:
isPossiblePartialTarget in class org.apache.myfaces.trinidad.context.PartialPageContext
Returns:
true if a component with this id should be rendered.
See Also:
isPartialTarget(java.lang.String)

isPartialTargetRendered

public boolean isPartialTargetRendered(java.lang.String id)
Tests whether the specified partial target has been rendered.

Specified by:
isPartialTargetRendered in class org.apache.myfaces.trinidad.context.PartialPageContext

areAllTargetsProcessed

public boolean areAllTargetsProcessed()
Returns true if all of the partial targets have been rendered.

Specified by:
areAllTargetsProcessed in class org.apache.myfaces.trinidad.context.PartialPageContext
Returns:
true if all of the partial targets have been rendered.

addPartialTarget

public void addPartialTarget(java.lang.String clientId)
Adds a new partial target to render.

This method may be called during the partial rendering pass to add to the set of partial targets, but only if the pass has not yet been completed. Clients should first check to see whether the partial rendering pass has finished by calling isPartialPassComplete() before calling this method.

Specified by:
addPartialTarget in class org.apache.myfaces.trinidad.context.PartialPageContext
Parameters:
clientId - The clientId of the partial target to render

isInsidePartialTarget

public boolean isInsidePartialTarget()
Returns true if we are inside of a partial target.

Specified by:
isInsidePartialTarget in class org.apache.myfaces.trinidad.context.PartialPageContext

addRenderedPartialTarget

public void addRenderedPartialTarget(java.lang.String clientId)
Adds a partial target that has already been rendered; this is needed if the "clientId" of a component does not match up to the top element (or elements).

Specified by:
addRenderedPartialTarget in class org.apache.myfaces.trinidad.context.PartialPageContext

getRenderedPartialTargets

public java.util.Iterator<java.lang.String> getRenderedPartialTargets()
Specified by:
getRenderedPartialTargets in class org.apache.myfaces.trinidad.context.PartialPageContext

getVisitContext

public javax.faces.component.visit.VisitContext getVisitContext()
Returns the VisitContext to use when partial rendering.

Specified by:
getVisitContext in class org.apache.myfaces.trinidad.context.PartialPageContext
Returns:
the VisitContext to use when partial rendering.

pushRenderedPartialTarget

public void pushRenderedPartialTarget(java.lang.String clientId)
Notifies the PartialPageContext that the specified partial target is about to be rendered.

This method is called automatically by Trinidad during the partial rendering pass when a partial target is about to be rendered. Clients should never need to call this method.

Parameters:
clientId - The clientId of the partial target that is about to be rendered
See Also:
popRenderedPartialTarget()

popRenderedPartialTarget

public void popRenderedPartialTarget()
Notifies the PartialPageContext that the current partial target has finished rendering.

This method is called automatically by Trinidad during the partial rendering pass when a partial target has finished rendering. Clients should never need to call this method.



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