|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.render.Renderer
org.apache.myfaces.trinidad.render.CoreRenderer
public class CoreRenderer
Basic implementation of the core rendering functionality across render kits.
Field Summary | |
---|---|
static char |
CHAR_UNDEFINED
|
static int |
NO_CHILD_INDEX
|
Constructor Summary | |
---|---|
protected |
CoreRenderer()
|
Method Summary | |
---|---|
protected void |
afterEncode(javax.faces.context.FacesContext context,
RenderingContext arc,
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 arc,
javax.faces.component.UIComponent component,
FacesBean bean)
Hook method that gets invoked before the component is encoded |
protected void |
delegateRenderer(javax.faces.context.FacesContext context,
RenderingContext arc,
javax.faces.component.UIComponent component,
FacesBean bean,
CoreRenderer renderer)
|
protected void |
delegateRendererBegin(javax.faces.context.FacesContext context,
RenderingContext arc,
javax.faces.component.UIComponent component,
FacesBean bean,
CoreRenderer renderer)
|
protected void |
delegateRendererEnd(javax.faces.context.FacesContext context,
RenderingContext arc,
javax.faces.component.UIComponent component,
FacesBean bean,
CoreRenderer renderer)
|
protected void |
encodeAll(javax.faces.context.FacesContext context,
RenderingContext arc,
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 arc,
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 |
encodeEnd(javax.faces.context.FacesContext context,
RenderingContext arc,
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)
|
protected java.lang.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,
java.lang.String name)
Gets a facet, verifying that the facet should be rendered. |
static int |
getNextRenderedChildIndex(java.util.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". |
protected static java.lang.Object |
getRenderingProperty(RenderingContext arc,
java.lang.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 arc)
|
static boolean |
isGecko(RenderingContext arc)
|
static boolean |
isGenericPDA(RenderingContext arc)
|
static boolean |
isIE(RenderingContext arc)
|
static boolean |
isInaccessibleMode(RenderingContext arc)
|
static boolean |
isIPhone(RenderingContext arc)
|
static boolean |
isPDA(RenderingContext arc)
|
static boolean |
isScreenReaderMode(RenderingContext arc)
|
static boolean |
isWebKit(RenderingContext arc)
|
VisitResult |
partialEncodeVisit(VisitContext visitContext,
PartialPageContext partialContext,
javax.faces.component.UIComponent component,
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,
java.lang.String name,
java.lang.Object value)
|
protected void |
renderEncodedResourceURI(javax.faces.context.FacesContext context,
java.lang.String name,
java.lang.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 arc,
java.lang.String styleClass)
Render a generic CSS styleClass (not one derived from an attribute). |
static void |
renderStyleClasses(javax.faces.context.FacesContext context,
RenderingContext rc,
java.lang.String[] styleClasses)
Render an array of CSS styleClasses as space-separated values. |
protected static java.lang.Object |
setRenderingProperty(RenderingContext arc,
java.lang.Object key,
java.lang.Object value)
|
void |
setupEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component)
|
void |
setupEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
UIXComponent component)
Called before rendering the current component's children in order to set up any special context. |
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 |
tearDownEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
javax.faces.component.UIComponent component)
|
void |
tearDownEncodingContext(javax.faces.context.FacesContext context,
RenderingContext rc,
UIXComponent component)
Called after rendering the current component's children in order to tear down any special context. |
static java.lang.String |
toActionUri(javax.faces.context.FacesContext fc,
java.lang.Object o)
Coerces an object into an action URI, calling the view-handler. |
static char |
toChar(java.lang.Object o)
Returns the character value of an object, XhtmlConstants.CHAR_UNDEFINED if there is none. |
static int |
toInt(java.lang.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(java.lang.Object o)
Returns the integer value of an object; this does not support null (which must be substituted with a default before calling). |
static java.lang.String |
toResourceUri(javax.faces.context.FacesContext fc,
java.lang.Object o)
Coerces an object into a resource URI, calling the view-handler. |
static java.lang.String |
toString(java.lang.Object o)
Coerces an object into a String. |
static java.lang.String |
toUri(java.lang.Object o)
Deprecated. use toResourceUri |
Methods inherited from class javax.faces.render.Renderer |
---|
convertClientId, decode, getConvertedValue, getRendersChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char CHAR_UNDEFINED
public static final int NO_CHILD_INDEX
Constructor Detail |
---|
protected CoreRenderer()
Method Detail |
---|
public VisitResult partialEncodeVisit(VisitContext visitContext, PartialPageContext partialContext, javax.faces.component.UIComponent component, 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 target
public void setupEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, UIXComponent component)
Called before rendering the current component'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, org.apache.myfaces.trinidad.component.UIXComponent)
public void setupEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component)
public void tearDownEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, UIXComponent component)
Called after rendering the current component's children 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 passsetupEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext, org.apache.myfaces.trinidad.component.UIXComponent)
public void tearDownEncodingContext(javax.faces.context.FacesContext context, RenderingContext rc, javax.faces.component.UIComponent component)
public static java.lang.String toString(java.lang.Object o)
public static java.lang.String toResourceUri(javax.faces.context.FacesContext fc, java.lang.Object o)
public static java.lang.String toActionUri(javax.faces.context.FacesContext fc, java.lang.Object o)
public static java.lang.String toUri(java.lang.Object o)
public static int toInt(java.lang.Object o)
public static long toLong(java.lang.Object o)
public static char toChar(java.lang.Object o)
public final void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
encodeBegin
in class javax.faces.render.Renderer
java.io.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 java.io.IOException
encodeEnd
in class javax.faces.render.Renderer
java.io.IOException
protected void encodeBegin(javax.faces.context.FacesContext context, RenderingContext arc, javax.faces.component.UIComponent component, FacesBean bean) throws java.io.IOException
java.io.IOException
protected void encodeEnd(javax.faces.context.FacesContext context, RenderingContext arc, javax.faces.component.UIComponent component, FacesBean bean) throws java.io.IOException
java.io.IOException
protected void encodeAll(javax.faces.context.FacesContext context, RenderingContext arc, javax.faces.component.UIComponent component, FacesBean bean) throws java.io.IOException
java.io.IOException
protected void encodeChild(javax.faces.context.FacesContext context, javax.faces.component.UIComponent child) throws java.io.IOException
java.io.IOException
protected void encodeAllChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
java.io.IOException
protected void delegateRenderer(javax.faces.context.FacesContext context, RenderingContext arc, javax.faces.component.UIComponent component, FacesBean bean, CoreRenderer renderer) throws java.io.IOException
java.io.IOException
protected void delegateRendererBegin(javax.faces.context.FacesContext context, RenderingContext arc, javax.faces.component.UIComponent component, FacesBean bean, CoreRenderer renderer) throws java.io.IOException
java.io.IOException
protected void delegateRendererEnd(javax.faces.context.FacesContext context, RenderingContext arc, javax.faces.component.UIComponent component, FacesBean bean, CoreRenderer renderer) throws java.io.IOException
java.io.IOException
protected void renderId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
java.io.IOException
protected java.lang.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 java.lang.Object getRenderingProperty(RenderingContext arc, java.lang.Object key)
protected static final java.lang.Object setRenderingProperty(RenderingContext arc, java.lang.Object key, java.lang.Object value)
public static javax.faces.component.UIComponent getFacet(javax.faces.component.UIComponent component, java.lang.String name)
public static boolean hasRenderedChildren(javax.faces.component.UIComponent component)
public static int getRenderedChildCount(javax.faces.component.UIComponent component)
public static int getNextRenderedChildIndex(java.util.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 arc)
public static boolean isPDA(RenderingContext arc)
public static boolean isIE(RenderingContext arc)
public static boolean isGecko(RenderingContext arc)
public static boolean isWebKit(RenderingContext arc)
public static boolean isIPhone(RenderingContext arc)
public static boolean isGenericPDA(RenderingContext arc)
public static boolean isInaccessibleMode(RenderingContext arc)
public static boolean isScreenReaderMode(RenderingContext arc)
protected void beforeEncode(javax.faces.context.FacesContext context, RenderingContext arc, 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 arc, javax.faces.component.UIComponent component, FacesBean bean)
#encodeEnd(FacesContext, RederingContext, UIComponent, FacesBean)
,
#encodeAll(FacesContext, RederingContext, UIComponent, FacesBean)
protected void renderEncodedActionURI(javax.faces.context.FacesContext context, java.lang.String name, java.lang.Object value) throws java.io.IOException
java.io.IOException
protected void renderEncodedResourceURI(javax.faces.context.FacesContext context, java.lang.String name, java.lang.Object value) throws java.io.IOException
java.io.IOException
public static void renderStyleClass(javax.faces.context.FacesContext context, RenderingContext arc, java.lang.String styleClass) throws java.io.IOException
context
- the FacesContextstyleClass
- the style class
java.io.IOException
public static void renderStyleClasses(javax.faces.context.FacesContext context, RenderingContext rc, java.lang.String[] styleClasses) throws java.io.IOException
context
- the FacesContextstyleClasses
- the style classes
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |