Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1)
E10684-06


oracle.adf.view.rich.render
Class RichRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.myfaces.trinidad.render.CoreRenderer
          extended by oracle.adf.view.rich.render.RichRenderer

All Implemented Interfaces:
java.lang.Cloneable, org.apache.myfaces.trinidad.render.TypedRenderer

public abstract class RichRenderer
extends org.apache.myfaces.trinidad.render.CoreRenderer
implements org.apache.myfaces.trinidad.render.TypedRenderer, java.lang.Cloneable

Base class for renderers of Rich Client components.

Overview

Developers subclassing this will generally need to override four methods:

A variety of other methods may be overridden to affect decoding or encoding behavior. This class extends the Trinidad CoreRenderer API, which contains a number of useful utility methods.

Decoding events

To decode an event sent by the client, override decodeInternal(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String) and call getClientEvent(javax.faces.context.FacesContext, java.lang.String, java.lang.String) with the type of the event you are expecting. A ClientEvent will contain a Map of objects with all the event-specific properties marshalled by the client.

Interacting with the RichRenderingContext

RichRenderingContext contains a number of APIs useful for sending information to the client. To retrieve a RichRenderingContext, call getRichRenderingContext(org.apache.myfaces.trinidad.context.RenderingContext).

Author:
Adam Winer
See Also:
ClientComponent, ClientMetadata, RichRenderingContext

Field Summary
static java.lang.String CHILDREN_THEME_PROPERTY
           
static java.lang.String ENABLE_THEME_PROPERTY
           
static java.lang.String THEME_ATTRIBUTE
           

 

Fields inherited from class org.apache.myfaces.trinidad.render.CoreRenderer
CHAR_UNDEFINED, NO_CHILD_INDEX

 

Constructor Summary
protected RichRenderer(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
          Creates a RichRenderer.

 

Method Summary
protected  void addAttributeChange(javax.faces.component.UIComponent comp, java.lang.String attrName, java.lang.Object attrValue)
          Adds an attribute change to persist the attribute value using change manager
 javax.faces.render.Renderer cloneWithType(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
          Clone a Renderer instance with a new Type; part of the TypedRenderer API.
static java.lang.String createClientSubId(java.lang.String clientId, java.lang.String name)
          Creates an identifier that can be used on the client to locate a piece of the DOM.
 DragSource createDefaultDragSource(javax.faces.component.UIComponent component, java.util.Set<DnDAction> allowedActions, DnDAction defaultAction, java.lang.String discriminant, javax.el.MethodExpression dragDropEndListener, java.util.Map<java.lang.String,?> properties)
          Renderer implementations should override this method to return the DragSource instance specific to the component (for e.g., when it overrides the DefaultDragSourceFactory interface)
 java.lang.String createDefaultDragSourceBehavior(javax.faces.component.UIComponent component, DragSource dragSource, java.util.Set<DnDAction> allowedActions, DnDAction defaultAction, java.lang.String discriminant, javax.el.MethodExpression dragDropEndListener, java.util.Map<java.lang.String,?> properties)
          Returns the JS clientDragSource initializer.
 java.lang.String createSubId(java.lang.String clientId, java.lang.String name)
          Creates an identifier that can be used on the client to locate a piece of the DOM.
 void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Override of decode() to provide default rich client functionality.
protected  boolean decodeIncompatiblePropertyKey(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String clientId, org.apache.myfaces.trinidad.bean.FacesBean bean, org.apache.myfaces.trinidad.bean.PropertyKey pKey, java.lang.String value)
          Subclasses can override this method to decode property keys whose types cannot be coerced by default.
 void decodeInternal(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String clientId)
          Hook for providing per-component decoding
protected  void decodeUnknownKey(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean, java.lang.String name, java.lang.Object value)
          Called when a key whose name is not known to the FacesBean has been synchronized.
protected  void delegateRenderer(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, javax.faces.component.UIComponent component, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean, org.apache.myfaces.trinidad.render.CoreRenderer renderer)
          Delegate to a child Renderer, building attributes into the same client component.
protected  void delegateRenderer(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, javax.faces.component.UIComponent childComponent, org.apache.myfaces.trinidad.render.CoreRenderer renderer)
          Delegate to a child Renderer building attributes into the child's ClientComponent.
protected  void delegateRenderer(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean, org.apache.myfaces.trinidad.render.CoreRenderer renderer)
          Delegate to a child Renderer without any attributes delivered to a client component.
protected abstract  void encodeAll(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, javax.faces.component.UIComponent component, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Hook for implementing renderer-specific rendering.
protected  void encodeAll(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Base rendering functionality for all rich renderers.
protected  void encodeChild(javax.faces.context.FacesContext context, javax.faces.component.UIComponent child)
           
protected
<S> boolean
encodeFlattenedComponents(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.component.ComponentProcessingContext cpContext, org.apache.myfaces.trinidad.component.ComponentProcessor<S> childProcessor, S callbackContext, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Encode the flattened components.
<S> boolean
encodeFlattenedComponents(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.component.ComponentProcessingContext cpContext, org.apache.myfaces.trinidad.component.ComponentProcessor<S> childProcessor, S callbackContext, javax.faces.component.UIComponent component)
          Encode the flattened components.
protected  void encodeStretchedChild(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, javax.faces.component.UIComponent component, java.lang.String parentPadding)
          Encodes the specified child including the additional styling to enable CSS stretching of the child.
protected  javax.faces.context.ResponseWriter encodeStretchedChildBegin(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, java.lang.String parentPadding)
          Prepares the FacesContext/ResponseWriter for encoding of a stretched child.
protected  javax.faces.context.ResponseWriter encodeStretchedChildBegin(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, java.lang.String parentTopPadding, java.lang.String parentRightPadding, java.lang.String parentBottomPadding, java.lang.String parentLeftPadding)
          Prepares the FacesContext/ResponseWriter for encoding of a stretched child.
protected  void encodeStretchedChildEnd(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter responseWriter)
          Completes the stretched child encoding which was initiated via a call to encodeStretchedChildBegin().
protected  void findTypeConstants(org.apache.myfaces.trinidad.bean.FacesBean.Type type, ClientMetadata metadata)
           
protected  java.util.Set<java.lang.String> getCheckedUnsecurePropertyNames(org.apache.myfaces.trinidad.bean.FacesBean bean)
          Retrieves unsecure property from the bean, also checks that the unsecure key names don't contain properties that are always secure.
protected  java.util.Set<java.lang.String> getClientAttributes(org.apache.myfaces.trinidad.bean.FacesBean bean)
          Returns the set of client attributes.
protected  ClientComponent.Type getClientComponentType(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Hook to identify the state-dependent type of the client component.
protected abstract  java.lang.String getClientConstructor()
          Hook to provide the name of the client-side object representing this renderer.
protected  ClientEvent getClientEvent(javax.faces.context.FacesContext context, java.lang.String clientId, java.lang.String type)
           
protected  java.lang.String getClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, ClientComponent client)
          A convenience method to return a clientId, taking advantage of the cached value in the ClientComponent if it is available.
static java.lang.Iterable<java.lang.String> getClientIdsToDecode(javax.faces.context.FacesContext context)
          Returns an Iterable that identifies any client IDs that need to be decoded on this request, but have not yet been.
protected  ClientListenerSet getClientListeners(org.apache.myfaces.trinidad.bean.FacesBean bean)
          Returns the client listeners.
protected  ClientComponent.Type getDefaultClientComponentType()
          Return the default client component type; this defaults to CREATE_WITH_REQUIRED_ATTRS.
protected  java.lang.String getDefaultStyleClass(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Override to return the default style class for this renderer.
 java.lang.String getDefaultStyleClass(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, javax.faces.component.UIComponent component)
          Return the default style class for this renderer.
 DragSource getDragSource(javax.faces.component.UIComponent component)
          Returns the default DragSource for the provided component.
 java.lang.String getDragSourceKey()
           
protected  ClientMetadata getEncodeClientMetadata(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Hook that allows overriding the client metadata used for encoding.
protected  java.lang.String getInlineStyle(org.apache.myfaces.trinidad.bean.FacesBean bean)
          Returns the value of the "inlineStyle" property.
protected  java.lang.String getPrependedInlineStyle(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Returns null or extra styles to prepend to the inlineStyle.
static javax.faces.render.Renderer getRenderer(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
static
<S> S
getRendererAs(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Class<S> rendererClass)
           
 boolean getRendersChildren()
          Overridden to return true; all rich renderers are "renders children".
static RichRenderer getRichRenderer(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
static RichRenderingContext getRichRenderingContext(org.apache.myfaces.trinidad.context.RenderingContext rc)
          Return the current RichRenderingContext.
protected  java.util.List<java.lang.String> getRootStateStyleClasses(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Deprecated. Use the getRootStateStyleClasses that also takes a UIComponent as a parameter. Also, if you upgrade your code to use the new API, make sure all your superclasses also use the new API. We currently call the old api from renderRootStyleAttributes (so people have time to migrate to the new API).
protected  java.util.List<java.lang.String> getRootStateStyleClasses(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, org.apache.myfaces.trinidad.bean.FacesBean bean, javax.faces.component.UIComponent component)
          Override to return any state-based (selected, disabled, etc.) CSS style markers.
protected  java.lang.String getShortDesc(org.apache.myfaces.trinidad.bean.FacesBean bean)
          Returns the value of the "shortDesc" property.
protected  java.lang.String getStyleClass(org.apache.myfaces.trinidad.bean.FacesBean bean)
          Returns the value of the "styleClass" property.
static java.lang.String getTheme(org.apache.myfaces.trinidad.context.RenderingContext renderingContext)
          Get the current theme from the rendering context's theme stack
protected  java.util.Set<java.lang.String> getUnsecurePropertyNames(org.apache.myfaces.trinidad.bean.FacesBean bean)
          Retrieves unsecure property from the bean
protected  boolean getVisible(org.apache.myfaces.trinidad.bean.FacesBean bean)
          Returns the visibility of the component.
 boolean hasDragSource(javax.faces.component.UIComponent component)
          Whether the component has a DragSource set.
protected static boolean isChildVisible(javax.faces.component.UIComponent child)
          Returns true if a child is "visible"
protected  boolean isLeafRenderer(javax.faces.component.UIComponent component)
          Is this a "leaf" component - one without any children? The default returns false.
 boolean isNextElementToBeStretched(javax.faces.context.FacesContext context)
          Determines whether the next written element will have element stretching styles added to it.
protected  boolean isThemeEnabled(javax.faces.context.FacesContext facesContext, org.apache.myfaces.trinidad.context.RenderingContext renderingContext, javax.faces.component.UIComponent uiComponent, org.apache.myfaces.trinidad.bean.FacesBean facesBean)
          Check if the component supports theming.
protected static void makeNonEmpty(javax.faces.context.FacesContext context)
          Forces some non-visible content to be rendered to give the containing content *some* space.
protected  boolean needsExplicitId(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Returns true if the component has an explicitly set ID that should be rendered/sent to the client.
protected  boolean needsExplicitId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Deprecated. this version of the method doesn't specify a RenderingContext
protected  boolean needsExplicitId(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Deprecated. this version of the method doesn't specify a FacesContext
static java.lang.String popTheme(org.apache.myfaces.trinidad.context.RenderingContext renderingContext)
          Remove the last theme from the rendering context's theme stack
static void pushTheme(org.apache.myfaces.trinidad.context.RenderingContext renderingContext, java.lang.String theme)
          Push the current theme onto the rendering context's theme stack.
protected  void renderAllRootAttributes(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean)
          This should be called once on the root dom element.
protected  void renderAllRootAttributes(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean, boolean renderStyleAttrs)
          Render the main renderer-specific attributes: "title", "class", "style", and all the Javascript attributes.
protected  void renderClickableIcon(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, boolean isTabStop, java.lang.String[] styleClasses, java.lang.String id, java.lang.String tooltipTextBundleKey, java.lang.String iconName)
          Deprecated. Use RichRenderUtils renderClickableIcon
static void renderClickableIcon(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, boolean isTabStop, java.lang.String targetURL, java.lang.String[] styleClasses, java.lang.String id, java.lang.String tooltipString, java.lang.String iconName)
          Renders a clickable icon with specified id, style classes, tooltip, skinnable icon name tabstop and targetURL feature.
protected  void renderFormattedText(javax.faces.context.FacesContext context, java.lang.Object textValue)
          Renders text as "formatted" text, as if it were the value of an <outputFormatted> component.
protected static void renderHAlign(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, java.lang.Object hAlign)
          Renders an halign attribute, automatically transforming "start" and "end" into "left" and "right" as necessary depending on the current user's reading direction.
static void renderHelpIcon(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, java.lang.String helpTopicId, java.lang.String styleClass, java.lang.String disabledStyleClass, java.lang.String iconName, java.lang.String altText)
          Renders the dynamic help icon.
protected  void renderId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, ClientComponent client)
          Renders the client ID as an "id".
protected  void renderPossiblyFormattedText(javax.faces.context.FacesContext context, java.lang.Object textValue)
          Renders text; if the text begins with "", render it as formatted text, otherwise render it as plain text.
protected  void renderRootStyleAttributes(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Deprecated. this version of the method doesn't specify a UIComponent
protected  void renderRootStyleAttributes(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean, java.lang.String defaultStyleClass)
          Deprecated. this version of the method doesn't specify a UIComponent
protected  void renderRootStyleAttributes(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Renders the root style attributes, merging in a defaultStyleClass (passed to this method) and any state style classes.
protected  void renderRootStyleAttributes(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean, java.lang.String defaultStyleClass)
          Renders the root style attributes, merging in a defaultStyleClass (passed to this method) and any state style classes.
protected  void renderRootStyleClasses(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean, java.lang.String defaultStyleClass, java.util.List<java.lang.String> stateStyleClasses)
          Renders the style classes on the root DOM element.
protected  void renderShortDescAttribute(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, ClientComponent client, org.apache.myfaces.trinidad.bean.FacesBean bean)
          Renders the shortDesc attribute as a "title" property, and adds it to the client component.
protected  void renderSpacer(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, java.lang.String width, java.lang.String height)
          Renders a spacer.
protected  void renderSpacer(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, java.lang.String width, java.lang.String height, java.lang.String id, java.lang.String shortDesc, javax.faces.component.UIComponent component)
          Renders a spacer.
protected  void renderSpacer(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, java.lang.String width, java.lang.String height, java.lang.String id, java.lang.String shortDesc, javax.faces.component.UIComponent component, java.lang.String inlineStyle)
          Renders a spacer.
static void renderStyleClass(javax.faces.context.FacesContext facesContext, org.apache.myfaces.trinidad.context.RenderingContext renderingContext, java.lang.String styleClass)
          Renders a style class with the current theme, if available.
static void renderStyleClasses(javax.faces.context.FacesContext facesContext, org.apache.myfaces.trinidad.context.RenderingContext renderingContext, java.lang.String[] styleClasses)
          Renders style classes with the current theme, if available.
protected  void renderVerticalSpacer(javax.faces.context.FacesContext context, java.lang.Object height, java.lang.Object id, javax.faces.component.UIComponent comp)
          Renders a vertical spacer for a specified non-null height.
 void setDragSource(DragSource dragSource, javax.faces.component.UIComponent component)
          Sets the default DragSource for the component in its attributes Map.
 void setupEncodingContext(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, org.apache.myfaces.trinidad.component.UIXComponent component)
           
protected  boolean shouldRenderId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  boolean skipDecode(javax.faces.context.FacesContext context)
          Can be overridden to detect if decoding this component should be skipped.
static boolean supportsAccessKeys(org.apache.myfaces.trinidad.context.RenderingContext arc)
          Returns true if the agent supports access keys.
 boolean supportsCSSStretching(org.apache.myfaces.trinidad.context.RenderingContext arc)
          Tests whether the agent supports CSS (top/bottom/left/right) stretching
protected  boolean supportsMessages()
          Returns whether the component supports messages.
static boolean supportsNavigation(org.apache.myfaces.trinidad.context.RenderingContext arc)
          Returns true if the agent supports page-to-page navigation.
static boolean supportsScrolling(org.apache.myfaces.trinidad.context.RenderingContext rc)
          Returns whether scrolling is supported by the agent.
 void tearDownEncodingContext(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, org.apache.myfaces.trinidad.component.UIXComponent component)
           

 

Methods inherited from class org.apache.myfaces.trinidad.render.CoreRenderer
afterEncode, beforeEncode, delegateRendererBegin, delegateRendererEnd, encodeAllChildren, encodeBegin, encodeBegin, encodeChildren, encodeEnd, encodeEnd, getClientId, getFacesBean, getFacet, getNextRenderedChildIndex, getRenderedChildCount, getRenderingProperty, hasRenderedChildren, isDesktop, isGecko, isGenericPDA, isIE, isInaccessibleMode, isIPhone, isKonqueror, isNokiaS60, isPDA, isScreenReaderMode, isWebKit, partialEncodeVisit, renderEncodedActionURI, renderEncodedResourceURI, renderId, setRenderingProperty, setupEncodingContext, tearDownEncodingContext, toActionUri, toChar, toInt, toLong, toResourceUri, toString, toUri

 

Methods inherited from class javax.faces.render.Renderer
convertClientId, getConvertedValue

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

THEME_ATTRIBUTE

public static final java.lang.String THEME_ATTRIBUTE
See Also:
Constant Field Values

ENABLE_THEME_PROPERTY

public static final java.lang.String ENABLE_THEME_PROPERTY
See Also:
Constant Field Values

CHILDREN_THEME_PROPERTY

public static final java.lang.String CHILDREN_THEME_PROPERTY
See Also:
Constant Field Values

Constructor Detail

RichRenderer

protected RichRenderer(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
Creates a RichRenderer.

Method Detail

cloneWithType

public javax.faces.render.Renderer cloneWithType(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
Clone a Renderer instance with a new Type; part of the TypedRenderer API.
Specified by:
cloneWithType in interface org.apache.myfaces.trinidad.render.TypedRenderer

getRendersChildren

public final boolean getRendersChildren()
Overridden to return true; all rich renderers are "renders children".
Overrides:
getRendersChildren in class javax.faces.render.Renderer

getClientIdsToDecode

public static final java.lang.Iterable<java.lang.String> getClientIdsToDecode(javax.faces.context.FacesContext context)
Returns an Iterable that identifies any client IDs that need to be decoded on this request, but have not yet been.

getRichRenderer

public static RichRenderer getRichRenderer(javax.faces.context.FacesContext context,
                                           javax.faces.component.UIComponent component)

getRendererAs

public static <S> S getRendererAs(javax.faces.context.FacesContext context,
                                  javax.faces.component.UIComponent component,
                                  java.lang.Class<S> rendererClass)

getRenderer

public static javax.faces.render.Renderer getRenderer(javax.faces.context.FacesContext context,
                                                      javax.faces.component.UIComponent component)

decode

public final void decode(javax.faces.context.FacesContext context,
                         javax.faces.component.UIComponent component)
Override of decode() to provide default rich client functionality. Developers must use the decodeInternal() hook to provide per-renderer decoding.
Overrides:
decode in class javax.faces.render.Renderer

decodeInternal

public void decodeInternal(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component,
                           java.lang.String clientId)
Hook for providing per-component decoding
Parameters:
context - the FacesContext
component - the component
clientId - the pre-computed clientId of this component

renderClickableIcon

public static void renderClickableIcon(javax.faces.context.FacesContext context,
                                       org.apache.myfaces.trinidad.context.RenderingContext rc,
                                       javax.faces.component.UIComponent component,
                                       boolean isTabStop,
                                       java.lang.String targetURL,
                                       java.lang.String[] styleClasses,
                                       java.lang.String id,
                                       java.lang.String tooltipString,
                                       java.lang.String iconName)
                                throws java.io.IOException
Renders a clickable icon with specified id, style classes, tooltip, skinnable icon name tabstop and targetURL feature. This replaces the deprecated renderClickableIcon.
Parameters:
context - the FacesContext.
rc - the RenderingContext.
component - the UIComponent that is rendered.
isTabStop - If true, the icon is rendered as tab stop and it can accept focus. Otherwise the icon is not tab stop and cannot accept focus.
targetURL - target URL when clicked.
styleClasses - Used to render style class names for the icon. If your style class uses background-image to display the icon, its attributes should ensure proper sizing in IE and FireFox. See ".AFClickableImageAnchor_16x16" in rich components-simple-desktop.css for an alias you may be able to use.
id - the html DOM id of the icon.
tooltipString - the tooltip for this element.
iconName - the icon name of the application skinned icon. It's normally used if you want a text-only icon or a accessible icon instead of a background-image on the styleClass.
Throws:
java.io.IOException

renderHelpIcon

public static void renderHelpIcon(javax.faces.context.FacesContext context,
                                  org.apache.myfaces.trinidad.context.RenderingContext rc,
                                  javax.faces.component.UIComponent component,
                                  java.lang.String helpTopicId,
                                  java.lang.String styleClass,
                                  java.lang.String disabledStyleClass,
                                  java.lang.String iconName,
                                  java.lang.String altText)
                           throws java.io.IOException
Renders the dynamic help icon. This includes rendering the help definition text if it exists, and the help system link if it exists.
Parameters:
context - the FacesContext.
rc - the RenderingContext.
component - the UIComponent that is rendered.
helpTopicId - the helpTopicId attribute.
styleClass - the style class to render on the help icon.
disabledStyleClass - the disabled style class to render if there is no help system link for the helpTopicId.
iconName - the icon style name of the help icon..
altText - the alt text to attempt to render if there is no definition text for accessibility.
Throws:
java.io.IOException

decodeIncompatiblePropertyKey

protected boolean decodeIncompatiblePropertyKey(javax.faces.context.FacesContext context,
                                                javax.faces.component.UIComponent component,
                                                java.lang.String clientId,
                                                org.apache.myfaces.trinidad.bean.FacesBean bean,
                                                org.apache.myfaces.trinidad.bean.PropertyKey pKey,
                                                java.lang.String value)
Subclasses can override this method to decode property keys whose types cannot be coerced by default. The default implementation simply returns false.
Parameters:
context - the FacesContext
component - the component
clientId - the component's client ID
bean - the FacesBean for the component
pKey - the PropertyKey being decoded
value - the String value of this property key
Returns:
true if the incompatible property key is decoded else false

decodeUnknownKey

protected void decodeUnknownKey(javax.faces.context.FacesContext context,
                                javax.faces.component.UIComponent component,
                                org.apache.myfaces.trinidad.bean.FacesBean bean,
                                java.lang.String name,
                                java.lang.Object value)
Called when a key whose name is not known to the FacesBean has been synchronized. Generally, this will be programmer error, so the default behavior is to log a warning. If overriding this method, always call super.decodeUnknownKey() if you have not handled the property.
Parameters:
context - the FacesContext
component - the component
bean - the FacesBean for the component
name - the name of the property
value - the value of this property key

getClientEvent

protected ClientEvent getClientEvent(javax.faces.context.FacesContext context,
                                     java.lang.String clientId,
                                     java.lang.String type)

findTypeConstants

protected void findTypeConstants(org.apache.myfaces.trinidad.bean.FacesBean.Type type,
                                 ClientMetadata metadata)

renderId

protected void renderId(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component,
                        ClientComponent client)
                 throws java.io.IOException
Renders the client ID as an "id". The client ID is retrieved from the ClientComponent if one is provided, otherwise from the UIComponent.
Throws:
java.io.IOException

needsExplicitId

protected final boolean needsExplicitId(javax.faces.component.UIComponent component,
                                        org.apache.myfaces.trinidad.bean.FacesBean bean)
Deprecated. this version of the method doesn't specify a FacesContext
Returns true if the component has an explicitly set ID.

needsExplicitId

protected final boolean needsExplicitId(javax.faces.context.FacesContext context,
                                        javax.faces.component.UIComponent component,
                                        org.apache.myfaces.trinidad.bean.FacesBean bean)
Deprecated. this version of the method doesn't specify a RenderingContext
Returns true if the component has an explicitly set ID.

needsExplicitId

protected final boolean needsExplicitId(javax.faces.context.FacesContext context,
                                        org.apache.myfaces.trinidad.context.RenderingContext rc,
                                        javax.faces.component.UIComponent component,
                                        org.apache.myfaces.trinidad.bean.FacesBean bean)
Returns true if the component has an explicitly set ID that should be rendered/sent to the client.

shouldRenderId

protected boolean shouldRenderId(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent component)
Overrides:
shouldRenderId in class org.apache.myfaces.trinidad.render.CoreRenderer

renderAllRootAttributes

protected void renderAllRootAttributes(javax.faces.context.FacesContext context,
                                       org.apache.myfaces.trinidad.context.RenderingContext arc,
                                       ClientComponent client,
                                       org.apache.myfaces.trinidad.bean.FacesBean bean)
                                throws java.io.IOException
This should be called once on the root dom element. Client properties are being added in here so this can only be called once
Throws:
java.io.IOException

renderAllRootAttributes

protected void renderAllRootAttributes(javax.faces.context.FacesContext context,
                                       org.apache.myfaces.trinidad.context.RenderingContext rc,
                                       ClientComponent client,
                                       org.apache.myfaces.trinidad.bean.FacesBean bean,
                                       boolean renderStyleAttrs)
                                throws java.io.IOException
Render the main renderer-specific attributes: "title", "class", "style", and all the Javascript attributes. Takes a boolean to determine if renderRootStyleAttributes should be called, which renders "class", "style"
Throws:
java.io.IOException

renderShortDescAttribute

protected void renderShortDescAttribute(javax.faces.context.FacesContext context,
                                        org.apache.myfaces.trinidad.context.RenderingContext arc,
                                        ClientComponent client,
                                        org.apache.myfaces.trinidad.bean.FacesBean bean)
                                 throws java.io.IOException
Renders the shortDesc attribute as a "title" property, and adds it to the client component.
Throws:
java.io.IOException

renderRootStyleAttributes

@Deprecated
protected final void renderRootStyleAttributes(javax.faces.context.FacesContext context,
                                                          org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                          ClientComponent client,
                                                          org.apache.myfaces.trinidad.bean.FacesBean bean)
                                        throws java.io.IOException
Deprecated. this version of the method doesn't specify a UIComponent
Renders the style attributes - "inlineStyle" and "styleClass" - merging in any default or state-based styles. This must be called once, and only on the root dom element
Throws:
java.io.IOException

renderRootStyleAttributes

@Deprecated
protected final void renderRootStyleAttributes(javax.faces.context.FacesContext context,
                                                          org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                          ClientComponent client,
                                                          org.apache.myfaces.trinidad.bean.FacesBean bean,
                                                          java.lang.String defaultStyleClass)
                                        throws java.io.IOException
Deprecated. this version of the method doesn't specify a UIComponent
Renders the root style attributes, merging in a defaultStyleClass (passed to this method) and any state style classes.
Throws:
java.io.IOException

renderRootStyleAttributes

protected final void renderRootStyleAttributes(javax.faces.context.FacesContext context,
                                               org.apache.myfaces.trinidad.context.RenderingContext rc,
                                               javax.faces.component.UIComponent component,
                                               ClientComponent client,
                                               org.apache.myfaces.trinidad.bean.FacesBean bean)
                                        throws java.io.IOException
Renders the root style attributes, merging in a defaultStyleClass (passed to this method) and any state style classes.
Throws:
java.io.IOException

renderRootStyleAttributes

protected final void renderRootStyleAttributes(javax.faces.context.FacesContext context,
                                               org.apache.myfaces.trinidad.context.RenderingContext rc,
                                               javax.faces.component.UIComponent component,
                                               ClientComponent client,
                                               org.apache.myfaces.trinidad.bean.FacesBean bean,
                                               java.lang.String defaultStyleClass)
                                        throws java.io.IOException
Renders the root style attributes, merging in a defaultStyleClass (passed to this method) and any state style classes.
Throws:
java.io.IOException

getRootStateStyleClasses

protected java.util.List<java.lang.String> getRootStateStyleClasses(javax.faces.context.FacesContext context,
                                                                    org.apache.myfaces.trinidad.context.RenderingContext arc,
                                                                    org.apache.myfaces.trinidad.bean.FacesBean bean)
Deprecated. Use the getRootStateStyleClasses that also takes a UIComponent as a parameter. Also, if you upgrade your code to use the new API, make sure all your superclasses also use the new API. We currently call the old api from renderRootStyleAttributes (so people have time to migrate to the new API).
Override to return any state-based (selected, disabled, etc.) CSS style markers. HINT: use an immutable, cached List<String> for better performance.

getRootStateStyleClasses

protected java.util.List<java.lang.String> getRootStateStyleClasses(javax.faces.context.FacesContext context,
                                                                    org.apache.myfaces.trinidad.context.RenderingContext arc,
                                                                    org.apache.myfaces.trinidad.bean.FacesBean bean,
                                                                    javax.faces.component.UIComponent component)
Override to return any state-based (selected, disabled, etc.) CSS style markers. HINT: use an immutable, cached List<String> for better performance.

renderRootStyleClasses

protected void renderRootStyleClasses(javax.faces.context.FacesContext context,
                                      org.apache.myfaces.trinidad.context.RenderingContext arc,
                                      ClientComponent client,
                                      org.apache.myfaces.trinidad.bean.FacesBean bean,
                                      java.lang.String defaultStyleClass,
                                      java.util.List<java.lang.String> stateStyleClasses)
                               throws java.io.IOException
Renders the style classes on the root DOM element.
Throws:
java.io.IOException

getDefaultStyleClass

protected java.lang.String getDefaultStyleClass(javax.faces.context.FacesContext context,
                                                org.apache.myfaces.trinidad.context.RenderingContext arc,
                                                org.apache.myfaces.trinidad.bean.FacesBean bean)
Override to return the default style class for this renderer. For proper skinnability, this will usually be a constant value; any state-based values should be delivered by getRootStateStyleClasses().

This value is used as the component selector in the skin to retrieve skin properties like -tr-enable-themes and -tr-children-theme. Returning a different value will prevent a component from being themed.


createDefaultDragSource

public DragSource createDefaultDragSource(javax.faces.component.UIComponent component,
                                          java.util.Set<DnDAction> allowedActions,
                                          DnDAction defaultAction,
                                          java.lang.String discriminant,
                                          javax.el.MethodExpression dragDropEndListener,
                                          java.util.Map<java.lang.String,?> properties)
Renderer implementations should override this method to return the DragSource instance specific to the component (for e.g., when it overrides the DefaultDragSourceFactory interface)
Parameters:
component -
allowedActions - Set of DnDAction allowed actions for the drag
defaultAction - the defaultAction
discriminant -
dragDropEndListener -
properties -
Returns:
a DragSource instance

createDefaultDragSourceBehavior

public java.lang.String createDefaultDragSourceBehavior(javax.faces.component.UIComponent component,
                                                        DragSource dragSource,
                                                        java.util.Set<DnDAction> allowedActions,
                                                        DnDAction defaultAction,
                                                        java.lang.String discriminant,
                                                        javax.el.MethodExpression dragDropEndListener,
                                                        java.util.Map<java.lang.String,?> properties)
Returns the JS clientDragSource initializer.
Parameters:
component - Component that this client DragSource is created for.
dragSource - DragSource to create clientDragSource initializer for
Returns:
String used to create the JS constructor for this DragSource

getDragSource

public DragSource getDragSource(javax.faces.component.UIComponent component)
Returns the default DragSource for the provided component.
Parameters:
component - the UIComponent
Returns:
DragSource instance or null if not DragSource exists for the component.

getDragSourceKey

public java.lang.String getDragSourceKey()

setDragSource

public void setDragSource(DragSource dragSource,
                          javax.faces.component.UIComponent component)
Sets the default DragSource for the component in its attributes Map. A valid DragSource instance is expected and null values are ignored.
Parameters:
dragSource - the default DragSource associated with the component.
component - the UIComponent.

hasDragSource

public boolean hasDragSource(javax.faces.component.UIComponent component)
Whether the component has a DragSource set.
Returns:
a boolean true if the DragSource is set on the component.

getDefaultStyleClass

public final java.lang.String getDefaultStyleClass(javax.faces.context.FacesContext context,
                                                   org.apache.myfaces.trinidad.context.RenderingContext arc,
                                                   javax.faces.component.UIComponent component)
Return the default style class for this renderer. Public so that other clases can access the default style class.

getClientId

protected final java.lang.String getClientId(javax.faces.context.FacesContext context,
                                             javax.faces.component.UIComponent component,
                                             ClientComponent client)
A convenience method to return a clientId, taking advantage of the cached value in the ClientComponent if it is available.

getRichRenderingContext

public static RichRenderingContext getRichRenderingContext(org.apache.myfaces.trinidad.context.RenderingContext rc)
Return the current RichRenderingContext.
Parameters:
rc - the current RenderingContext

isLeafRenderer

protected boolean isLeafRenderer(javax.faces.component.UIComponent component)
Is this a "leaf" component - one without any children? The default returns false. If overridden, rendering can be optimized.

encodeAll

protected final void encodeAll(javax.faces.context.FacesContext context,
                               org.apache.myfaces.trinidad.context.RenderingContext arc,
                               javax.faces.component.UIComponent component,
                               org.apache.myfaces.trinidad.bean.FacesBean bean)
                        throws java.io.IOException
Base rendering functionality for all rich renderers. Builds a ClientComponent and calls the encodeAll() hook for subclassers.
Overrides:
encodeAll in class org.apache.myfaces.trinidad.render.CoreRenderer
Throws:
java.io.IOException

encodeFlattenedComponents

public final <S> boolean encodeFlattenedComponents(javax.faces.context.FacesContext context,
                                                   org.apache.myfaces.trinidad.component.ComponentProcessingContext cpContext,
                                                   org.apache.myfaces.trinidad.component.ComponentProcessor<S> childProcessor,
                                                   S callbackContext,
                                                   javax.faces.component.UIComponent component)
                                        throws java.io.IOException
Encode the flattened components. This should only be called in between a UIXComponent.setUpEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext) and UIXComponent.tearDownEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext) on the component.
Throws:
java.io.IOException

encodeFlattenedComponents

protected <S> boolean encodeFlattenedComponents(javax.faces.context.FacesContext context,
                                                org.apache.myfaces.trinidad.component.ComponentProcessingContext cpContext,
                                                org.apache.myfaces.trinidad.component.ComponentProcessor<S> childProcessor,
                                                S callbackContext,
                                                org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                javax.faces.component.UIComponent component,
                                                ClientComponent client,
                                                org.apache.myfaces.trinidad.bean.FacesBean bean)
                                     throws java.io.IOException
Encode the flattened components. This should only be called in between a UIXComponent.setUpEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext) and UIXComponent.tearDownEncodingContext(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.RenderingContext) on the component.
Throws:
java.io.IOException

encodeAll

protected abstract void encodeAll(javax.faces.context.FacesContext context,
                                  org.apache.myfaces.trinidad.context.RenderingContext arc,
                                  javax.faces.component.UIComponent component,
                                  ClientComponent client,
                                  org.apache.myfaces.trinidad.bean.FacesBean bean)
                           throws java.io.IOException
Hook for implementing renderer-specific rendering.
Throws:
java.io.IOException

delegateRenderer

protected void delegateRenderer(javax.faces.context.FacesContext context,
                                org.apache.myfaces.trinidad.context.RenderingContext arc,
                                javax.faces.component.UIComponent component,
                                ClientComponent client,
                                org.apache.myfaces.trinidad.bean.FacesBean bean,
                                org.apache.myfaces.trinidad.render.CoreRenderer renderer)
                         throws java.io.IOException
Delegate to a child Renderer, building attributes into the same client component.
Throws:
java.io.IOException

delegateRenderer

protected void delegateRenderer(javax.faces.context.FacesContext context,
                                org.apache.myfaces.trinidad.context.RenderingContext arc,
                                javax.faces.component.UIComponent component,
                                org.apache.myfaces.trinidad.bean.FacesBean bean,
                                org.apache.myfaces.trinidad.render.CoreRenderer renderer)
                         throws java.io.IOException
Delegate to a child Renderer without any attributes delivered to a client component.
Overrides:
delegateRenderer in class org.apache.myfaces.trinidad.render.CoreRenderer
Throws:
java.io.IOException

delegateRenderer

protected void delegateRenderer(javax.faces.context.FacesContext context,
                                org.apache.myfaces.trinidad.context.RenderingContext arc,
                                javax.faces.component.UIComponent childComponent,
                                org.apache.myfaces.trinidad.render.CoreRenderer renderer)
                         throws java.io.IOException
Delegate to a child Renderer building attributes into the child's ClientComponent.
Throws:
java.io.IOException

getClientConstructor

protected abstract java.lang.String getClientConstructor()
Hook to provide the name of the client-side object representing this renderer. HINT: if you do not have a client-side object, you should not be subclassing RichRenderer! Subclass the Trinidad CoreRenderer class, or the ordinary JSF Renderer class; these Renderers will work with the Rich Client.

getEncodeClientMetadata

protected ClientMetadata getEncodeClientMetadata(javax.faces.context.FacesContext context,
                                                 org.apache.myfaces.trinidad.context.RenderingContext arc,
                                                 org.apache.myfaces.trinidad.bean.FacesBean bean)
Hook that allows overriding the client metadata used for encoding. The client metadata for decoding (what values are secure) cannot be overridden.

createSubId

public java.lang.String createSubId(java.lang.String clientId,
                                    java.lang.String name)
Creates an identifier that can be used on the client to locate a piece of the DOM. This implementation is guaranteed to match the Javascript implementation of AdfRichUIPeer.CreateSubId().
Parameters:
clientId - the client ID of this component
name - the name of the piece of the DOM

createClientSubId

public static java.lang.String createClientSubId(java.lang.String clientId,
                                                 java.lang.String name)
Creates an identifier that can be used on the client to locate a piece of the DOM. This implementation is guaranteed to match the Javascript implementation of AdfRichUIPeer.CreateSubId().
Parameters:
clientId - the client ID of this component
name - the name of the piece of the DOM

getClientComponentType

protected ClientComponent.Type getClientComponentType(javax.faces.context.FacesContext context,
                                                      javax.faces.component.UIComponent component,
                                                      org.apache.myfaces.trinidad.bean.FacesBean bean)
Hook to identify the state-dependent type of the client component. The default behavior will return CREATE_WITH_ALL_ATTRS if clientComponent="true"; otherwise, it will return getDefaultClientComponentType().

Note that Components should never override the default value of clientComponent to be true, but should instead return CREATE_WITH_ATTRS from this function (which is the default behavior)


getDefaultClientComponentType

protected ClientComponent.Type getDefaultClientComponentType()
Return the default client component type; this defaults to CREATE_WITH_REQUIRED_ATTRS.

supportsMessages

protected boolean supportsMessages()
Returns whether the component supports messages. By default, returns true. Override to return false if the component never supports messages.

supportsScrolling

public static boolean supportsScrolling(org.apache.myfaces.trinidad.context.RenderingContext rc)
Returns whether scrolling is supported by the agent. TODO we should use capabilities instead.

getVisible

protected boolean getVisible(org.apache.myfaces.trinidad.bean.FacesBean bean)
Returns the visibility of the component.

getShortDesc

protected java.lang.String getShortDesc(org.apache.myfaces.trinidad.bean.FacesBean bean)
Returns the value of the "shortDesc" property.

getUnsecurePropertyNames

protected java.util.Set<java.lang.String> getUnsecurePropertyNames(org.apache.myfaces.trinidad.bean.FacesBean bean)
Retrieves unsecure property from the bean
Parameters:
bean - FacesBean instance
Returns:
the unsecure property value, which is the list of attribute names that can be unsecured.

getCheckedUnsecurePropertyNames

protected java.util.Set<java.lang.String> getCheckedUnsecurePropertyNames(org.apache.myfaces.trinidad.bean.FacesBean bean)
Retrieves unsecure property from the bean, also checks that the unsecure key names don't contain properties that are always secure. We ignore properties that are never secure and let them pass back to the client. If it does, an IllegalArgumentException will be thrown.
Parameters:
bean - FacesBean instance
Returns:
the set of property names that is marked unsecure on this component instance.

getStyleClass

protected java.lang.String getStyleClass(org.apache.myfaces.trinidad.bean.FacesBean bean)
Returns the value of the "styleClass" property.

getPrependedInlineStyle

protected java.lang.String getPrependedInlineStyle(javax.faces.context.FacesContext context,
                                                   org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                   javax.faces.component.UIComponent component,
                                                   ClientComponent client,
                                                   org.apache.myfaces.trinidad.bean.FacesBean bean)
Returns null or extra styles to prepend to the inlineStyle.
Returns:
null or extra styles to prepend to the inlineStyle (terminated by a semicolon)

getInlineStyle

protected java.lang.String getInlineStyle(org.apache.myfaces.trinidad.bean.FacesBean bean)
Returns the value of the "inlineStyle" property.

getClientAttributes

protected java.util.Set<java.lang.String> getClientAttributes(org.apache.myfaces.trinidad.bean.FacesBean bean)
Returns the set of client attributes.

getClientListeners

protected ClientListenerSet getClientListeners(org.apache.myfaces.trinidad.bean.FacesBean bean)
Returns the client listeners.

isChildVisible

protected static boolean isChildVisible(javax.faces.component.UIComponent child)
Returns true if a child is "visible"

encodeStretchedChild

protected void encodeStretchedChild(javax.faces.context.FacesContext context,
                                    org.apache.myfaces.trinidad.context.RenderingContext arc,
                                    javax.faces.component.UIComponent component,
                                    java.lang.String parentPadding)
                             throws java.io.IOException
Encodes the specified child including the additional styling to enable CSS stretching of the child. We use the CSS top/left/bottom/right properties to stretch the child to fill all of the parent's available space. We need to explicitly exclude the parent's padding - the caller must pass this in via the parentPadding value. For the moment, we assume that top/left/bottom/right padding are all the same. Note that on some browsers additional work must be performed on the client to fully implement stretching. See the client-side AdfAgent.prepareStretchedChild() and AdfAgent.resizeStretchedChild() APIs.
Parameters:
context - The Faces context
component - The child component to encode
parentPadding - The CSS padding value (eg. "1px").
Throws:
java.io.IOException
See Also:
encodeStretchedChildBegin(FacesContext, RenderingContext, String), isNextElementToBeStretched(FacesContext)

encodeStretchedChildBegin

protected javax.faces.context.ResponseWriter encodeStretchedChildBegin(javax.faces.context.FacesContext context,
                                                                       org.apache.myfaces.trinidad.context.RenderingContext arc,
                                                                       java.lang.String parentPadding)
                                                                throws java.io.IOException
Prepares the FacesContext/ResponseWriter for encoding of a stretched child. Returns the ResponseWriter which is used to insert any stretching-related styles on the child content. All calls to encodeStretchedChildBegin() must be followed by a matching call to encodeStretchedChildEnd(). Important usage note: If you use encodeStretchedChildBegin() before writing an element and then subsequently you encode a child component that may be conditionally stretched, then you must ensure that the element written after you call this API has an explicit "style" attribute written to it by the ResponseWriter (even just a style with a value of "") or else the child component may render incorrectly because isNextElementToBeStretched() will return an invalid result.
Throws:
java.io.IOException
See Also:
encodeStretchedChild(FacesContext, RenderingContext, UIComponent, String), encodeStretchedChildEnd(FacesContext, ResponseWriter), isNextElementToBeStretched(FacesContext)

encodeStretchedChildBegin

protected javax.faces.context.ResponseWriter encodeStretchedChildBegin(javax.faces.context.FacesContext context,
                                                                       org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                                       java.lang.String parentTopPadding,
                                                                       java.lang.String parentRightPadding,
                                                                       java.lang.String parentBottomPadding,
                                                                       java.lang.String parentLeftPadding)
                                                                throws java.io.IOException
Prepares the FacesContext/ResponseWriter for encoding of a stretched child. Returns the ResponseWriter which is used to insert any stretching-related styles on the child content. All calls to encodeStretchedChildBegin() must be followed by a matching call to encodeStretchedChildEnd().
Throws:
java.io.IOException
See Also:
encodeStretchedChild(FacesContext, RenderingContext, UIComponent, String), encodeStretchedChildEnd(FacesContext, ResponseWriter), isNextElementToBeStretched(FacesContext)

encodeStretchedChildEnd

protected void encodeStretchedChildEnd(javax.faces.context.FacesContext context,
                                       javax.faces.context.ResponseWriter responseWriter)
                                throws java.io.IOException
Completes the stretched child encoding which was initiated via a call to encodeStretchedChildBegin(). The ResponseWriter that was returned by encodeStretchedChildBegin must be passed into encodeStretchedChildEnd().
Throws:
java.io.IOException

isNextElementToBeStretched

public boolean isNextElementToBeStretched(javax.faces.context.FacesContext context)
Determines whether the next written element will have element stretching styles added to it. Important usage note: To guarantee safe use of this API, it must be invoked after starting the root element of your Renderer. In some cases it may be impossible to invoke this API after starting your root element because the result of this API is what determines what your root element needs to be. Some elements can never be stretched consistently across web browsers and some stretchable elements do not flow in a manner that is important for your component's design; you need to know which root element to use. In order for you to get an accurate result from this API prior to staring your root element, you are at the mercy of the Renderer of your parent component. The cases where this API could incorrectly return true is if that parent component's Renderer meets one of the following criteria: 1.) it is using RichRenderer.encodeStretchedChildBegin() on an element that surrounds your component, or 2.) it is only generating a root element (no other internal elements are rendered). Renderers that meet this criteria can guarantee that they play well with children components by simply ensuring that they write an explicit style to the ResponseWriter on the element that surrounds a child component (even just a style with a value of ""). This will notify the ResponseWriter that this parent element has consumed the stretched styles and resets the stretching state for the next component thus making this API return the correct value both before and immediately after that child component's root element has been started.
Parameters:
context - the FacesContext
Returns:
true if the next written element will have stretching styles added, false otherwise
See Also:
encodeStretchedChild(FacesContext, RenderingContext, UIComponent, String), encodeStretchedChildBegin(FacesContext, RenderingContext, String)

supportsCSSStretching

public boolean supportsCSSStretching(org.apache.myfaces.trinidad.context.RenderingContext arc)
Tests whether the agent supports CSS (top/bottom/left/right) stretching

renderClickableIcon

@Deprecated
protected void renderClickableIcon(javax.faces.context.FacesContext context,
                                              org.apache.myfaces.trinidad.context.RenderingContext rc,
                                              javax.faces.component.UIComponent component,
                                              boolean isTabStop,
                                              java.lang.String[] styleClasses,
                                              java.lang.String id,
                                              java.lang.String tooltipTextBundleKey,
                                              java.lang.String iconName)
                            throws java.io.IOException
Deprecated. Use RichRenderUtils renderClickableIcon
Renders a clickable icon with specified id, style classes, tooltip, skinnable icon name and tabstop feature.
Parameters:
context - the FacesContext.
rc - the RenderingContext.
component - the UIComponent that is rendered.
isTabStop - If true, the icon is rendered as tab stop and it can accept focus. Otherwise the icon is not tab stop and cannot accept focus.
styleClasses - Used to render style class names for the icon. If your style class uses background-image to display the icon, its attributes should ensure proper sizing in IE and FireFox. See ".AFClickableImageAnchor_16x16" in rich components-simple-desktop.css for an alias you may be able to use.
id - the html DOM id of the icon.
tooltipTextBundleKey - the key for the translated string to be displayed as tooltip.
iconName - the icon name of the application skinned icon. It's normally used as text only icon. If a valid icon name is passed in, that icon will be displayed and background-image style in styleClasses will have no effect in UI.
Throws:
java.io.IOException

makeNonEmpty

protected static void makeNonEmpty(javax.faces.context.FacesContext context)
                            throws java.io.IOException
Forces some non-visible content to be rendered to give the containing content *some* space. This method is intended for use by Renderers which generate an outer div which contains only absolutely positioned contents. This causes problems for IE when the width/height is 100%, since IE will not automatically stretch these contents. In particular, IE will not stretch these contents if they are inserted into the page via ppr, but instead only stretches such contents after the first browser resize event. Since we expect that clients will need to set width/height to 100% on geometry managing components such as panelStretchLayout and panelSplitter when embedding these inside showDetailItem, we need to make sure that these components produce some content. This can be assured by calling makeNonEmpty() somewhere after the root div is rendered.
Throws:
java.io.IOException

supportsAccessKeys

public static boolean supportsAccessKeys(org.apache.myfaces.trinidad.context.RenderingContext arc)
Returns true if the agent supports access keys.

supportsNavigation

public static boolean supportsNavigation(org.apache.myfaces.trinidad.context.RenderingContext arc)
Returns true if the agent supports page-to-page navigation.

skipDecode

protected boolean skipDecode(javax.faces.context.FacesContext context)
Can be overridden to detect if decoding this component should be skipped.
Overrides:
skipDecode in class org.apache.myfaces.trinidad.render.CoreRenderer

renderHAlign

protected static void renderHAlign(javax.faces.context.FacesContext context,
                                   org.apache.myfaces.trinidad.context.RenderingContext arc,
                                   java.lang.Object hAlign)
                            throws java.io.IOException
Renders an halign attribute, automatically transforming "start" and "end" into "left" and "right" as necessary depending on the current user's reading direction.
Throws:
java.io.IOException

renderPossiblyFormattedText

protected final void renderPossiblyFormattedText(javax.faces.context.FacesContext context,
                                                 java.lang.Object textValue)
                                          throws java.io.IOException
Renders text; if the text begins with "", render it as formatted text, otherwise render it as plain text.
Throws:
java.io.IOException

renderFormattedText

protected final void renderFormattedText(javax.faces.context.FacesContext context,
                                         java.lang.Object textValue)
                                  throws java.io.IOException
Renders text as "formatted" text, as if it were the value of an <outputFormatted> component. See the documentation for RichOutputFormatted.
Throws:
java.io.IOException

renderSpacer

protected final void renderSpacer(javax.faces.context.FacesContext context,
                                  org.apache.myfaces.trinidad.context.RenderingContext arc,
                                  java.lang.String width,
                                  java.lang.String height)
                           throws java.io.IOException
Renders a spacer.
Throws:
java.io.IOException

renderSpacer

protected final void renderSpacer(javax.faces.context.FacesContext context,
                                  org.apache.myfaces.trinidad.context.RenderingContext arc,
                                  java.lang.String width,
                                  java.lang.String height,
                                  java.lang.String id,
                                  java.lang.String shortDesc,
                                  javax.faces.component.UIComponent component)
                           throws java.io.IOException
Renders a spacer.
Throws:
java.io.IOException

renderSpacer

protected final void renderSpacer(javax.faces.context.FacesContext context,
                                  org.apache.myfaces.trinidad.context.RenderingContext arc,
                                  java.lang.String width,
                                  java.lang.String height,
                                  java.lang.String id,
                                  java.lang.String shortDesc,
                                  javax.faces.component.UIComponent component,
                                  java.lang.String inlineStyle)
                           throws java.io.IOException
Renders a spacer.
Throws:
java.io.IOException

renderVerticalSpacer

protected final void renderVerticalSpacer(javax.faces.context.FacesContext context,
                                          java.lang.Object height,
                                          java.lang.Object id,
                                          javax.faces.component.UIComponent comp)
                                   throws java.io.IOException
Renders a vertical spacer for a specified non-null height.
Throws:
java.io.IOException

addAttributeChange

protected void addAttributeChange(javax.faces.component.UIComponent comp,
                                  java.lang.String attrName,
                                  java.lang.Object attrValue)
Adds an attribute change to persist the attribute value using change manager
Parameters:
comp -
attrName -
attrValue -

setupEncodingContext

public void setupEncodingContext(javax.faces.context.FacesContext context,
                                 org.apache.myfaces.trinidad.context.RenderingContext rc,
                                 org.apache.myfaces.trinidad.component.UIXComponent component)
Overrides:
setupEncodingContext in class org.apache.myfaces.trinidad.render.CoreRenderer

tearDownEncodingContext

public void tearDownEncodingContext(javax.faces.context.FacesContext context,
                                    org.apache.myfaces.trinidad.context.RenderingContext rc,
                                    org.apache.myfaces.trinidad.component.UIXComponent component)
Overrides:
tearDownEncodingContext in class org.apache.myfaces.trinidad.render.CoreRenderer

encodeChild

protected void encodeChild(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent child)
                    throws java.io.IOException
Overrides:
encodeChild in class org.apache.myfaces.trinidad.render.CoreRenderer
Throws:
java.io.IOException

isThemeEnabled

protected boolean isThemeEnabled(javax.faces.context.FacesContext facesContext,
                                 org.apache.myfaces.trinidad.context.RenderingContext renderingContext,
                                 javax.faces.component.UIComponent uiComponent,
                                 org.apache.myfaces.trinidad.bean.FacesBean facesBean)
Check if the component supports theming. If a component supports themeing, then theme HTML attributes are added to the HTML written by the renderer for this component when a style class is added to the output.

Note that this is not related to if a component changes the theme by pushing the current theme onto the RichRenderingContext.

The default implementation checks to see if the base style class has the "-tr-enable-themes" property set to "true" in the skin. Typically called from setupEncodingContext(FacesContext, RenderingContext, UIXComponent)
Parameters:
facesContext - facesContext instance
renderingContext - current rendering context
uiComponent - component being rendered
facesBean - faces bean of the component
Returns:
true if theme attributes should be added to the elements of this component
See Also:
ENABLE_THEME_PROPERTY, setupEncodingContext(FacesContext, RenderingContext, UIXComponent), renderStyleClass(FacesContext, RenderingContext, String), renderStyleClasses(FacesContext, RenderingContext, String[])

renderStyleClasses

public static void renderStyleClasses(javax.faces.context.FacesContext facesContext,
                                      org.apache.myfaces.trinidad.context.RenderingContext renderingContext,
                                      java.lang.String[] styleClasses)
                               throws java.io.IOException
Renders style classes with the current theme, if available. This method uses CoreRenderer.renderStyleClasses(FacesContext, RenderingContext, String[]) to render a style classes. If there is a current theme, it is appended to the array of style classes.
Parameters:
facesContext - The current FacesContext
renderingContext - The current RenderingContext
styleClasses - The styleClasses to render
Throws:
java.io.IOException - If rendering fails

renderStyleClass

public static void renderStyleClass(javax.faces.context.FacesContext facesContext,
                                    org.apache.myfaces.trinidad.context.RenderingContext renderingContext,
                                    java.lang.String styleClass)
                             throws java.io.IOException
Renders a style class with the current theme, if available. This method uses CoreRenderer.renderStyleClass(FacesContext, RenderingContext, String) to render a style class. If there is a current theme, CoreRenderer.renderStyleClasses(FacesContext, RenderingContext, String[]) is used with the theme as the second style class in the array.
Parameters:
facesContext - The current FacesContext
renderingContext - The current RenderingContext
styleClass - The styleClass to render
Throws:
java.io.IOException - If rendering fails

getTheme

public static java.lang.String getTheme(org.apache.myfaces.trinidad.context.RenderingContext renderingContext)
Get the current theme from the rendering context's theme stack
Parameters:
renderingContext - The current rendering context
Returns:
The current theme
See Also:
pushTheme(RenderingContext, String)

pushTheme

public static void pushTheme(org.apache.myfaces.trinidad.context.RenderingContext renderingContext,
                             java.lang.String theme)
Push the current theme onto the rendering context's theme stack.
Parameters:
renderingContext - The current rendering context
theme - The new/current theme
See Also:
RichRenderingContext.pushTheme(String), popTheme(RenderingContext)

popTheme

public static java.lang.String popTheme(org.apache.myfaces.trinidad.context.RenderingContext renderingContext)
Remove the last theme from the rendering context's theme stack
Parameters:
renderingContext - The current rendering context
Returns:
The theme that was popped
See Also:
pushTheme(RenderingContext, String)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1)
E10684-06


Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.