org.apache.myfaces.trinidadinternal.ui
Interface UIXRenderingContext

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
FacesRenderingContext, LogicalNodeRenderingContext, RenderedNodeRenderingContext, RootRenderingContext

public interface UIXRenderingContext
extends java.lang.Cloneable

Context for a single rendering pass over a tree of UINodes. RendererContexts do not last longer than a single rendering, so any state stored on the context will not be persistent.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/ui/RenderingContext.java#0 $) $Date: 10-nov-2005.18:50:20 $
Author:
The Oracle ADF Faces Team

Field Summary
static java.lang.Object CONTEXT_PATH_PROPERTY
          This property is used to retrieve the file system path corresponding to the root of the current servlet context.
static java.lang.Object CONTEXT_URI_PROPERTY
          This property is used to retrieve the URI corresponding to the root of the current servlet context.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of the RenderingContext.
 TrinidadAgent getAgent()
          Returns an Agent object that can be used to identify what device will display the rendering.
 UINode getAncestorNode(int index)
          Returns a logical ancestor of the node currently being processed.
 int getAncestorNodeCount()
          Returns the number of logical nodes in the path form the current node to the root of the tree of nodes being rendered.
 Configuration getConfiguration()
          Returns a Configuration object that will be used to locate paths and return global properties.
 DataObject getCurrentDataObject()
          Returns a DataObject for the current node (such as a row of a table).
 DataObject getDataObject(java.lang.String namespaceURI, java.lang.String name)
          Returns the DataObject for the given namespace and name pair.
 DataObject getDataObject(UIXRenderingContext outerContext, java.lang.String namespaceURI, java.lang.String name)
          Internal version of getDataObject().
 javax.faces.context.FacesContext getFacesContext()
           
 FormEncoder getFormEncoder()
           
 org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName)
           
 ImageContext getImageContext()
          Get an interface that can be used for image lookups and rendering.
 org.apache.myfaces.trinidad.context.LocaleContext getLocaleContext()
          Returns the LocaleContext that should be used for rendering.
 java.lang.Object getLocalProperty(int ancestorIndex, java.lang.Object key, java.lang.Object defaultValue)
          Retrieves the specifed property from the stack frame of a rendering UINode.
 LookAndFeel getLookAndFeel()
          Returns the LookAndFeel to use for this render.
 UIXRenderingContext getParentContext()
          Returns the RenderingContext that this context should delegate calls to pushRenderedChild, popRenderedChild, and addDataProvider to.
 org.apache.myfaces.trinidad.context.PartialPageContext getPartialPageContext()
           
 Path getPath()
          Returns the path to the current logical node.
 java.lang.Object getProperty(java.lang.String namespace, java.lang.Object key)
          Gets a property stored on the context.
 UINode getRenderedAncestorNode(int index)
          Returns an ancestor of the node currently being processed.
 int getRenderedAncestorNodeCount()
          Returns the number of rendered nodes in the path form the current node being rendered to the root of the tree of nodes being rendered.
 RendererManager getRendererManager()
          Returns the RendererManager that should be used for finding renderers.
 javax.faces.context.ResponseWriter getResponseWriter()
          Returns the ResponseWriter that should be used for rendering text.
 org.apache.myfaces.trinidad.skin.Skin getSkin()
          Returns the Skin to use for this render.
 java.util.Map<java.lang.String,java.lang.String> getSkinResourceKeyMap()
          Get the translatedValue Map.
 java.lang.Object getStyleClass(java.lang.String key)
           
 StyleContext getStyleContext()
          Get an interface that can be used for style lookups and generation.
 java.lang.String getTranslatedString(java.lang.String key)
          Returns a translated string from the skin.
 java.lang.Object getTranslatedValue(java.lang.String key)
          Returns a translated value from the skin.
 URLEncoder getURLEncoder()
           
 UIVariableResolver getVariableResolver()
          gets the VariableResolver to use for this render cycle
 void popChild()
          Removes a logical UINode from the stack.
 void popRenderedChild(UIXRenderingContext currentContext)
          Removes the UINode to actually use to render from the rendered UINode stack.
 void pushChild(UINode child, java.lang.String childName, int childIndex)
          Adds the logical UINode to render to the logical stack.
 void pushRenderedChild(UIXRenderingContext currentContext, UINode renderedChild)
          Adds the UINode to actually use to render to the rendered UINode stack.
 DataObject setCurrentDataObject(DataObject newDataObject)
          Sets the new currentDataObject, returning the current currentDataObject.
 void setLocalProperty(java.lang.Object key, java.lang.Object value)
          Sets a property on the stack frame of the currently rendering UINode using a key.
 void setProperty(java.lang.String namespace, java.lang.Object key, java.lang.Object value)
          Stores a property on the context.
 void setResponseWriter(javax.faces.context.ResponseWriter writer)
          Sets the ResponseWriter that should be used for rendering text.
 void setSkinResourceKeyMap(java.util.Map<java.lang.String,java.lang.String> mapping)
          Store a Map that maps a skin's resource keys from one key to another.
 

Field Detail

CONTEXT_PATH_PROPERTY

static final java.lang.Object CONTEXT_PATH_PROPERTY
This property is used to retrieve the file system path corresponding to the root of the current servlet context. ServletRenderingContext will automatically provide this value. Clients that need to explicitly set this value must also set the CONTEXT_URI_PROPERTY to the correct corresponding value, but such cients should instead use a non-default Configuration object.


CONTEXT_URI_PROPERTY

static final java.lang.Object CONTEXT_URI_PROPERTY
This property is used to retrieve the URI corresponding to the root of the current servlet context. ServletRenderingContext will automatically provide this value. Clients that need to explicitly set this value must also set the CONTEXT_PATH_PROPERTY to the correct corresponding value, but such cients should instead use a non-default Configuration object. This value must not be terminated with a "/".

Method Detail

getFacesContext

javax.faces.context.FacesContext getFacesContext()

getLookAndFeel

LookAndFeel getLookAndFeel()
Returns the LookAndFeel to use for this render.


getSkin

org.apache.myfaces.trinidad.skin.Skin getSkin()
Returns the Skin to use for this render.


getRendererManager

RendererManager getRendererManager()
Returns the RendererManager that should be used for finding renderers.


getResponseWriter

javax.faces.context.ResponseWriter getResponseWriter()
Returns the ResponseWriter that should be used for rendering text.


setResponseWriter

void setResponseWriter(javax.faces.context.ResponseWriter writer)
Sets the ResponseWriter that should be used for rendering text.


setSkinResourceKeyMap

void setSkinResourceKeyMap(java.util.Map<java.lang.String,java.lang.String> mapping)
Store a Map that maps a skin's resource keys from one key to another. For example, if the renderer uses a new HideShowBean, it will need to map the HideShowBean's keys to its keys. It can store the map here, so that context.getTranslatedValue(key) can use this map to get the correct translated value key.

Parameters:
mapping -

getSkinResourceKeyMap

java.util.Map<java.lang.String,java.lang.String> getSkinResourceKeyMap()
Get the translatedValue Map.

Parameters:
mapping -

getTranslatedValue

java.lang.Object getTranslatedValue(java.lang.String key)
Returns a translated value from the skin. This value may or may not be a String, and developers should avoid calling toString() unless absolutely necessary.


getTranslatedString

java.lang.String getTranslatedString(java.lang.String key)
Returns a translated string from the skin.


getIcon

org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName)

getStyleClass

java.lang.Object getStyleClass(java.lang.String key)

getAgent

TrinidadAgent getAgent()
Returns an Agent object that can be used to identify what device will display the rendering.


getLocaleContext

org.apache.myfaces.trinidad.context.LocaleContext getLocaleContext()
Returns the LocaleContext that should be used for rendering. The LocaleContext is the owner of all LocaleSpecific information about the Locale.


getAncestorNodeCount

int getAncestorNodeCount()
Returns the number of logical nodes in the path form the current node to the root of the tree of nodes being rendered.

See Also:
getAncestorNode(int), getRenderedAncestorNodeCount(), getPath()

getAncestorNode

UINode getAncestorNode(int index)
Returns a logical ancestor of the node currently being processed. The zero-based index from least to most distant - getAncestorNode(0) will always return the current node. Returns null if the index is greater than or equal to the number of ancestors.

See Also:
getAncestorNodeCount(), getRenderedAncestorNode(int), getPath()

getRenderedAncestorNodeCount

int getRenderedAncestorNodeCount()
Returns the number of rendered nodes in the path form the current node being rendered to the root of the tree of nodes being rendered.

Because a single logical node may be transformed into multiple nodes for rendering, the rendered node count will always be equal to or greater than the logical node count.

Typically, Renderer implementations are the only callers to this method.

See Also:
getAncestorNodeCount()

getRenderedAncestorNode

UINode getRenderedAncestorNode(int index)
Returns an ancestor of the node currently being processed. The zero-based index from least to most distant - getRenderedAncestorNode(0) will always return the current rendering node. Returns null if the index is greater than or equal to the number of ancestors.

Because a single logical node may be transformed into multiple nodes for rendering, the rendered node count will always be equal to or greater than the logical node count.

Typically, Renderer implementations are the only callers to this method.

See Also:
getAncestorNode(int)

getPath

Path getPath()
Returns the path to the current logical node.

See Also:
getAncestorNodeCount(), getAncestorNode(int)

pushChild

void pushChild(UINode child,
               java.lang.String childName,
               int childIndex)
Adds the logical UINode to render to the logical stack. Clients should never call this method. They should instead subclass BaseRenderer, which calls this method when needed.

See Also:
popChild(), getAncestorNode(int), getAncestorNodeCount(), getPath()

popChild

void popChild()
Removes a logical UINode from the stack. Clients should never call this method; they should instead subclass BaseRenderer, which calls this method when needed.

See Also:
pushChild(org.apache.myfaces.trinidadinternal.ui.UINode, java.lang.String, int), getAncestorNode(int), getAncestorNodeCount(), getPath()

pushRenderedChild

void pushRenderedChild(UIXRenderingContext currentContext,
                       UINode renderedChild)
Adds the UINode to actually use to render to the rendered UINode stack.

Clients shuld never need to call this method as calls to this method are typically made on their behalf by the composite UINode framework.

Parameters:
currentContext - The RenderingContext that is used when rendering the specified child node.
renderedChild - The UINode that is being rendered.
See Also:
popRenderedChild(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext), getRenderedAncestorNode(int), getRenderedAncestorNodeCount()

popRenderedChild

void popRenderedChild(UIXRenderingContext currentContext)
Removes the UINode to actually use to render from the rendered UINode stack.

Clients shuld never need to call this method as calls to this method are typically made on their behalf by the composite UINode framework.

Parameters:
currentContext - The current RenderingContext. That is, the context that was used to render the UINode that is being popped from the rendered child stack.
See Also:
pushRenderedChild(org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext, org.apache.myfaces.trinidadinternal.ui.UINode), getRenderedAncestorNode(int), getRenderedAncestorNodeCount()

getDataObject

DataObject getDataObject(java.lang.String namespaceURI,
                         java.lang.String name)
Returns the DataObject for the given namespace and name pair. It will call each data provider added with addDataProvider, starting with the most recently added, until one returns non-null. It can then check for any implementation-specific DataObjects.

See Also:
#addDataProvider

getCurrentDataObject

DataObject getCurrentDataObject()
Returns a DataObject for the current node (such as a row of a table).


setCurrentDataObject

DataObject setCurrentDataObject(DataObject newDataObject)
Sets the new currentDataObject, returning the current currentDataObject.

See Also:
getCurrentDataObject()

getVariableResolver

UIVariableResolver getVariableResolver()
gets the VariableResolver to use for this render cycle


getProperty

java.lang.Object getProperty(java.lang.String namespace,
                             java.lang.Object key)
Gets a property stored on the context.


setProperty

void setProperty(java.lang.String namespace,
                 java.lang.Object key,
                 java.lang.Object value)
Stores a property on the context. Since RendererContexts are not persistent, state stored on a RendererContext will not be present in subsequent rendering passes.


setLocalProperty

void setLocalProperty(java.lang.Object key,
                      java.lang.Object value)
Sets a property on the stack frame of the currently rendering UINode using a key.

This method is for use by rendering code that needs to save some state while it is rendering.

Parameters:
key - Key used to identify this property on the stack frame.
value - Value to store. null is an acceptable value.

See Also:
getLocalProperty(int, java.lang.Object, java.lang.Object)

getLocalProperty

java.lang.Object getLocalProperty(int ancestorIndex,
                                  java.lang.Object key,
                                  java.lang.Object defaultValue)
Retrieves the specifed property from the stack frame of a rendering UINode. If the property is not present, defaultValue is returned.

The keys are compared by identity for performance.

This method is for use by rendering code that needs to save some state while it is rendering.

Parameters:
ancestorIndex - index into the rendered ancestor stack. If 0, uses the currently rendering node
key - Key used to identify the property on the stack frame to retrieve.
defaultValue - Value to return if the property doesn't exist in the stack frame.

See Also:
setLocalProperty(java.lang.Object, java.lang.Object)

getFormEncoder

FormEncoder getFormEncoder()
Returns:
the encoder that must be used for form values and client parameters added by JavaScript.

getURLEncoder

URLEncoder getURLEncoder()
Returns:
the encoder that must be used for form parameter names and URLs

getConfiguration

Configuration getConfiguration()
Returns a Configuration object that will be used to locate paths and return global properties.


getImageContext

ImageContext getImageContext()
Get an interface that can be used for image lookups and rendering.


getStyleContext

StyleContext getStyleContext()
Get an interface that can be used for style lookups and generation.


getParentContext

UIXRenderingContext getParentContext()
Returns the RenderingContext that this context should delegate calls to pushRenderedChild, popRenderedChild, and addDataProvider to. The parent context acts to segregate the logical node structure internal to a composite UINode from the deceloper's logical UINode structure. By calling getParentContext.getAncestorNode(0) the composite UINode gains access to the UINode that the composite UINode is attempting to render.

Typically, only composite UINode implementors ever need to call this method.


getPartialPageContext

org.apache.myfaces.trinidad.context.PartialPageContext getPartialPageContext()

getDataObject

DataObject getDataObject(UIXRenderingContext outerContext,
                         java.lang.String namespaceURI,
                         java.lang.String name)
Internal version of getDataObject(). Do not call this function unless you are yourself a RenderingContext.


clone

java.lang.Object clone()
Returns a clone of the RenderingContext.



Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.