public class CoreRenderer
extends javax.faces.render.Renderer
Modifier and Type | Field and Description |
---|---|
static char |
CHAR_UNDEFINED |
static int |
NO_CHILD_INDEX |
Modifier | Constructor and Description |
---|---|
protected |
CoreRenderer() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterEncode(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component,
FacesBean bean)
Hook method that gets invoked after the component is encoded
|
protected void |
beforeEncode(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component,
FacesBean bean)
Hook method that gets invoked before the component is encoded
|
void |
broadcast(UIXComponent component,
javax.faces.event.FacesEvent event)
Allows the renderer for a Trinidad component to react to faces events broadcast on a component.
|
void |
decode(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component) |
protected void |
decode(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
FacesBean facesBean,
String clientId)
Hook for sub-classes to perform their own decode logic
|
protected String |
decodeBehaviors(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
FacesBean bean)
Decodes the behaviors of this component, if it is the component that is the source
of the call to the server and the event matches behaviors that are attached to
the component
|
protected void |
delegateRenderer(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component,
FacesBean bean,
CoreRenderer renderer) |
protected void |
delegateRendererBegin(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component,
FacesBean bean,
CoreRenderer renderer) |
protected void |
delegateRendererEnd(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component,
FacesBean bean,
CoreRenderer renderer) |
protected void |
encodeAll(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component,
FacesBean bean)
Hook for rendering all of a component; only
called if getRendersChildren() is true.
|
protected void |
encodeAllChildren(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
protected void |
encodeBegin(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component,
FacesBean bean)
Hook for rendering the start of a component; only
called if getRendersChildren() is false.
|
void |
encodeBegin(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
protected void |
encodeChild(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent child)
Hook for encoding a child; this assumes that isRendered()
has already been called.
|
void |
encodeChildren(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
protected void |
encodeComponentResources(javax.faces.context.FacesContext context,
String target)
Hook for rendering the component resources for the
target . |
protected void |
encodeEnd(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component,
FacesBean bean)
Hook for rendering the end of a component; only
called if getRendersChildren() is false.
|
void |
encodeEnd(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
static Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> |
getBehaviorParameters(javax.faces.component.UIComponent component)
Get a collection of all the parameters that are children of the current component as
client behavior parameters.
|
protected String |
getClientId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Returns the client ID that should be used for rendering (if
shouldRenderId(javax.faces.context.FacesContext, javax.faces.component.UIComponent) returns true). |
protected FacesBean |
getFacesBean(javax.faces.component.UIComponent component) |
static javax.faces.component.UIComponent |
getFacet(javax.faces.component.UIComponent component,
String name)
Gets a facet, verifying that the facet should be rendered.
|
static int |
getNextRenderedChildIndex(List<javax.faces.component.UIComponent> components,
int afterChildIndex) |
static int |
getRenderedChildCount(javax.faces.component.UIComponent component)
Returns the total number of children with rendered=="true".
|
Iterator<javax.faces.component.UIComponent> |
getRenderedFacetsAndChildren(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
Allows the rendered to specify what components should be involved with rendered children
life-cycle operations and methods.
|
protected static Object |
getRenderingProperty(RenderingContext rc,
Object key) |
static boolean |
hasRenderedChildren(javax.faces.component.UIComponent component)
Returns true if the component has children and at least
one has rendered=="true".
|
static boolean |
isDesktop(RenderingContext rc) |
static boolean |
isGecko(RenderingContext rc) |
static boolean |
isGenericPDA(RenderingContext rc) |
static boolean |
isIE(RenderingContext rc) |
static boolean |
isInaccessibleMode(RenderingContext rc) |
static boolean |
isIPhone(RenderingContext rc) |
static boolean |
isKonqueror(RenderingContext rc) |
static boolean |
isNokiaS60(RenderingContext rc)
This method returns true if a user-agent's platform is NokiaS60
|
static boolean |
isOpera(RenderingContext rc) |
static boolean |
isPDA(RenderingContext rc) |
static boolean |
isScreenReaderMode(RenderingContext rc) |
static boolean |
isWebKit(RenderingContext rc) |
javax.faces.component.visit.VisitResult |
partialEncodeVisit(javax.faces.component.visit.VisitContext visitContext,
PartialPageContext partialContext,
javax.faces.component.UIComponent component,
javax.faces.component.visit.VisitCallback callback)
Called when visiting the CoreRenderer's component during optimized partial page encoding so
that the CoreRenderer can modify what is actually encoded.
|
protected void |
renderEncodedActionURI(javax.faces.context.FacesContext context,
String name,
Object value) |
protected void |
renderEncodedResourceURI(javax.faces.context.FacesContext context,
String name,
Object value) |
protected void |
renderId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Renders the client ID as an "id".
|
static void |
renderStyleClass(javax.faces.context.FacesContext context,
RenderingContext rc,
String styleClass)
Render a generic CSS styleClass (not one derived from an attribute).
|
static void |
renderStyleClasses(javax.faces.context.FacesContext context,
RenderingContext rc,
String[] styleClasses)
Render an array of CSS styleClasses as space-separated values.
|
protected static Object |
setRenderingProperty(RenderingContext rc,
Object key,
Object value) |
void |
setupChildrenEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component)
Called before rendering the current component's children in order to set
up any special context.
|
void |
setupEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component)
Called before rendering the current comopnent's children in order to set
up any special context.
|
void |
setupEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
UIXComponent component)
Deprecated.
|
protected boolean |
shouldRenderId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Returns true if the component should render an ID.
|
protected boolean |
skipDecode(javax.faces.context.FacesContext context) |
void |
tearDownChildrenEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component)
Called after rendering the current component's children in order to tear
down any special context.
|
void |
tearDownEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component)
Called after rendering the current component in order to tear
down any special context.
|
void |
tearDownEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
UIXComponent component)
Deprecated.
|
static String |
toActionUri(javax.faces.context.FacesContext fc,
Object o)
Coerces an object into an action URI, calling the view-handler.
|
static char |
toChar(Object o)
Returns the character value of an object, XhtmlConstants.CHAR_UNDEFINED
if there is none.
|
static int |
toInt(Object o)
Returns the integer value of an object; this does
not support null (which must be substituted with a default
before calling).
|
static long |
toLong(Object o)
Returns the integer value of an object; this does
not support null (which must be substituted with a default
before calling).
|
static String |
toResourceUri(javax.faces.context.FacesContext fc,
Object o)
Coerces an object into a resource URI, calling the view-handler.
|
static String |
toString(Object o)
Coerces an object into a String.
|
static String |
toUri(Object o)
Deprecated.
use toResourceUri
|
boolean |
visitChildrenForEncoding(UIXComponent component,
javax.faces.component.visit.VisitContext visitContext,
javax.faces.component.visit.VisitCallback callback)
Hook to allow the renderer to customize the visitation of the children components
of a component during the visitation of a component during rendering.
|
public static final char CHAR_UNDEFINED
public static final int NO_CHILD_INDEX
public void broadcast(UIXComponent component, javax.faces.event.FacesEvent event)
component
- The componentevent
- The eventpublic Iterator<javax.faces.component.UIComponent> getRenderedFacetsAndChildren(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
facesContext
- the faces contextcomponent
- the component from which to get the rendered facets and childrenUIXComponentBase#getRenderedFacetsAndChildren(FacesContext)
public javax.faces.component.visit.VisitResult partialEncodeVisit(javax.faces.component.visit.VisitContext visitContext, PartialPageContext partialContext, javax.faces.component.UIComponent component, javax.faces.component.visit.VisitCallback callback)
Called when visiting the CoreRenderer's component during optimized partial page encoding so that the CoreRenderer 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 calls the VisitCallback and returns its result if this UIXComponent is a partial target of the current encoding.
visitContext
- VisitContext to pass to the VisitCallbackpartialContext
- PartialPageContext for the current partial encodingcomponent
- The component for the CoreRenderer to visitcallback
- VisitCallback to call if this component is a partial targetpublic void setupEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component)
Called before rendering the current comopnent's children in order to set up any special context.
If setupEncodingContext
succeeds then
tearDownEncodingContext
will be called for the same component.
The default implementation does nothing
context
- FacesContext for this requestrc
- RenderingContext for this encoding passtearDownEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext, javax.faces.component.UIComponent)
@Deprecated public void setupEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, UIXComponent component)
public void setupChildrenEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component)
Called before rendering the current component's children in order to set up any special context.
If setupChildrenEncodingContext
succeeds then
tearDownChildrenEncodingContext
will be called for the same component.
The default implementation does nothing
context
- FacesContext for this requestrc
- RenderingContext for this encoding passcomponent
- Component to encode using this RenderertearDownChildrenEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext, javax.faces.component.UIComponent)
public void tearDownEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component)
Called after rendering the current component in order to tear down any special context.
tearDownEncodingContext
will be called on the component if
setupEncodingContext
succeeded.
The default implementation does nothing
context
- FacesContext for this requestrc
- RenderingContext for this encoding passcomponent
- Component to encode using this RenderersetupEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext, javax.faces.component.UIComponent)
public boolean visitChildrenForEncoding(UIXComponent component, javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback callback)
component
- the component which owns the children to visitvisitContext
- the visitation contextcallback
- the visit callbacktrue
if the visit is complete.UIXComponent.visitChildren(VisitContext, VisitCallback)
@Deprecated public void tearDownEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, UIXComponent component)
public void tearDownChildrenEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component)
Called after rendering the current component's children in order to tear down any special context.
tearDownChildrenEncodingContext
will be called on the component if
setupChildrenEncodingContext
succeeded.
The default implementation does nothing
context
- FacesContext for this requestrc
- RenderingContext for this encoding passcomponent
- Component to encode using this RenderersetupChildrenEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext, javax.faces.component.UIComponent)
public final void decode(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
Sub-classes should override the
decode(FacesContext, UIComponent, FacesBean, String)
method
to perform their own decoding logic
decode
in class javax.faces.render.Renderer
decode(FacesContext, UIComponent, FacesBean, String)
protected void decode(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, FacesBean facesBean, String clientId)
facesContext
- the faces contextcomponent
- the component to decodefacesBean
- the faces bean for the componentclientId
- the client ID if it has been retrieved already
during decoding, otherwise it will be null. Passed in for performance
reasons, so that if it has already been retrieved it will not need to be
retrieved againpublic static String toResourceUri(javax.faces.context.FacesContext fc, Object o)
public static String toActionUri(javax.faces.context.FacesContext fc, Object o)
@Deprecated public static String toUri(Object o)
public static int toInt(Object o)
public static long toLong(Object o)
public static char toChar(Object o)
public final void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws IOException
encodeBegin
in class javax.faces.render.Renderer
IOException
public final void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
encodeChildren
in class javax.faces.render.Renderer
public final void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws IOException
encodeEnd
in class javax.faces.render.Renderer
IOException
protected void encodeBegin(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component, FacesBean bean) throws IOException
IOException
protected final void encodeComponentResources(javax.faces.context.FacesContext context, String target) throws IOException
target
.context
- Current FacesContext
object for this request.target
- The target for the resources (e.g. head/body/form)IOException
protected void encodeEnd(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component, FacesBean bean) throws IOException
IOException
protected void encodeAll(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component, FacesBean bean) throws IOException
IOException
protected void encodeChild(javax.faces.context.FacesContext context, javax.faces.component.UIComponent child) throws IOException
IOException
protected void encodeAllChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws IOException
IOException
protected void delegateRenderer(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component, FacesBean bean, CoreRenderer renderer) throws IOException
IOException
protected void delegateRendererBegin(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component, FacesBean bean, CoreRenderer renderer) throws IOException
IOException
protected void delegateRendererEnd(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component, FacesBean bean, CoreRenderer renderer) throws IOException
IOException
protected void renderId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws IOException
IOException
protected String getClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
shouldRenderId(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
returns true).protected boolean shouldRenderId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
protected boolean skipDecode(javax.faces.context.FacesContext context)
protected FacesBean getFacesBean(javax.faces.component.UIComponent component)
protected static final Object getRenderingProperty(RenderingContext rc, Object key)
protected static final Object setRenderingProperty(RenderingContext rc, Object key, Object value)
public static javax.faces.component.UIComponent getFacet(javax.faces.component.UIComponent component, String name)
public static boolean hasRenderedChildren(javax.faces.component.UIComponent component)
public static int getRenderedChildCount(javax.faces.component.UIComponent component)
public static int getNextRenderedChildIndex(List<javax.faces.component.UIComponent> components, int afterChildIndex)
afterChildIndex
- The children coming after this index, will
be considered.NO_CHILD_INDEX
if there is none.public static boolean isDesktop(RenderingContext rc)
public static boolean isPDA(RenderingContext rc)
public static boolean isIE(RenderingContext rc)
public static boolean isKonqueror(RenderingContext rc)
public static boolean isGecko(RenderingContext rc)
public static boolean isWebKit(RenderingContext rc)
public static boolean isOpera(RenderingContext rc)
public static boolean isIPhone(RenderingContext rc)
public static boolean isGenericPDA(RenderingContext rc)
public static boolean isNokiaS60(RenderingContext rc)
arc
- - RenderingContext of a requestpublic static boolean isInaccessibleMode(RenderingContext rc)
public static boolean isScreenReaderMode(RenderingContext rc)
protected void beforeEncode(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component, FacesBean bean)
#encodeBegin(FacesContext, RederingContext, UIComponent, FacesBean)
,
#encodeAll(FacesContext, RederingContext, UIComponent, FacesBean)
protected void afterEncode(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component, FacesBean bean)
#encodeEnd(FacesContext, RederingContext, UIComponent, FacesBean)
,
#encodeAll(FacesContext, RederingContext, UIComponent, FacesBean)
protected final String decodeBehaviors(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, FacesBean bean)
facesContext
- the faces contextcomponent
- the componentbean
- the faces beanpublic static Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> getBehaviorParameters(javax.faces.component.UIComponent component)
component
- The componentprotected void renderEncodedActionURI(javax.faces.context.FacesContext context, String name, Object value) throws IOException
IOException
protected void renderEncodedResourceURI(javax.faces.context.FacesContext context, String name, Object value) throws IOException
IOException
public static void renderStyleClass(javax.faces.context.FacesContext context, RenderingContext rc, String styleClass) throws IOException
context
- the FacesContextstyleClass
- the style classIOException
public static void renderStyleClasses(javax.faces.context.FacesContext context, RenderingContext rc, String[] styleClasses) throws IOException
context
- the FacesContextstyleClasses
- the style classesIOException
Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.