org.apache.myfaces.trinidadinternal.ui
Class RootRenderingContext

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.ui.LogicalNodeRenderingContext
      extended by org.apache.myfaces.trinidadinternal.ui.RenderedNodeRenderingContext
          extended by org.apache.myfaces.trinidadinternal.ui.RootRenderingContext
All Implemented Interfaces:
java.lang.Cloneable, ImageContext, UIXRenderingContext
Direct Known Subclasses:
FacesRenderingContext

public abstract class RootRenderingContext
extends RenderedNodeRenderingContext
implements ImageContext

Default implementation of RenderingContext used as the root for rendering a tree of UINodes. Developers that need to render UINode content outside of a Servlet or JSP should use this class, but all others should use its subclass, ServletRenderingContext.

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

Field Summary
 
Fields inherited from interface org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext
CONTEXT_PATH_PROPERTY, CONTEXT_URI_PROPERTY
 
Constructor Summary
RootRenderingContext()
          Creates a RootRenderingContext using the default RendererManager instance.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of the RenderingContext.
protected  UIVariableResolver createVariableResolver()
          creates a variable resolver to use with this render cycle
 Configuration getConfiguration()
          Returns a Configuration object that will be used to locate paths and return global properties.
 DataObject getDataObject(java.lang.String namespaceURI, java.lang.String name)
          Returns the DataObject for the given namespace and name pair.
 DataObject getDataObject(UIXRenderingContext context, java.lang.String namespaceURI, java.lang.String name)
          Returns the DataObject for the given namespace and name pair.
protected  int getDefaultNodeStackSize()
          Returns the default initial number of nodes in the stack of logical nodes.
protected  int getDefaultPropertyMapSize()
          Returns the default size of the PropertyMap used to store properties on the RenderingContext.
 javax.faces.context.FacesContext getFacesContext()
           
 java.lang.String getFacet()
          Returns the rendering facet in use.
 FormEncoder getFormEncoder()
          This implementation returns an encoder that does no special encoding.
 org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName)
          We'll look at the reading direction and append :rtl if needed to the name
 ImageContext getImageContext()
          Get an interface that can be used for image lookups and rendering.
abstract  org.apache.myfaces.trinidad.context.LocaleContext getLocaleContext()
          Returns the LocaleContext that should be used for rendering.
 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.
 java.lang.Object getProperty(java.lang.String namespace, java.lang.Object key)
          Gets a property stored on the context.
 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.
 java.lang.Object getStyleClass(java.lang.String key)
           
 java.lang.String getTranslatedString(java.lang.String key)
          Returns a translated String from the skin's resource bundle.
 java.lang.Object getTranslatedValue(java.lang.String key)
          Returns a translated value from the skin's resource bundle.
 URLEncoder getURLEncoder()
          This implementation returns an encoder that does no special encoding, and returns an empty string as the default URL.
 UIVariableResolver getVariableResolver()
          gets the VariableResolver to use for this render cycle
 void init(javax.faces.context.FacesContext fContext)
           
 void setConfiguration(Configuration config)
          Sets the configuration for use with this rendering pass.
 void setDataObject(java.lang.String namespaceURI, java.lang.String name, DataObject dataObject)
          Stores a data object on the context.
 void setDataObjectMap(java.lang.String namespaceURI, java.util.Map<java.lang.String,DataObject> dataObjectDict)
          Registers a dictionary for use in retrieving and storing data objects for a single namespace.
 void setFacet(java.lang.String facet)
          Sets the facet of the current look-and-feel.
 void setFormEncoder(FormEncoder formEncoder)
          This implementation returns an encoder that does no special encoding.
 void setResponseWriter(javax.faces.context.ResponseWriter writer)
          Sets the ResponseWriter that should be used for rendering text.
 void setURLEncoder(URLEncoder urlEncoder)
          This implementation returns an encoder that does no special encoding, and returns an empty string as the default URL.
 
Methods inherited from class org.apache.myfaces.trinidadinternal.ui.RenderedNodeRenderingContext
getLocalProperty, getRenderedAncestorNode, getRenderedAncestorNodeCount, getRenderingProperty, popRenderedChild, pushRenderedChild, reset, resetProperties, setLocalProperty, setProperty, setRenderingProperty
 
Methods inherited from class org.apache.myfaces.trinidadinternal.ui.LogicalNodeRenderingContext
getAncestorNode, getAncestorNodeCount, getCurrentDataObject, getPath, getSkinResourceMappedKey, popChild, pushChild, setCurrentDataObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.trinidadinternal.image.ImageContext
getAgent, getStyleContext, setProperty
 
Methods inherited from interface org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext
getAgent, getPartialPageContext, getSkin, getSkinResourceKeyMap, getStyleContext, setSkinResourceKeyMap
 

Constructor Detail

RootRenderingContext

public RootRenderingContext()
Creates a RootRenderingContext using the default RendererManager instance.

Method Detail

init

public void init(javax.faces.context.FacesContext fContext)

getFacesContext

public javax.faces.context.FacesContext getFacesContext()
Specified by:
getFacesContext in interface UIXRenderingContext
Overrides:
getFacesContext in class LogicalNodeRenderingContext

setConfiguration

public void setConfiguration(Configuration config)
Sets the configuration for use with this rendering pass. If set to null, the configuration will return to the default behavior.


getLookAndFeel

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

Specified by:
getLookAndFeel in interface UIXRenderingContext

getFacet

public java.lang.String getFacet()
Returns the rendering facet in use.


setFacet

public void setFacet(java.lang.String facet)
Sets the facet of the current look-and-feel. This must not be called after getRendererManager()


getRendererManager

public RendererManager getRendererManager()
Returns the RendererManager that should be used for finding renderers. The default implementation returns the manager registered on the Configuration, if any; if that fails, it returns a globally shared instance,

Specified by:
getRendererManager in interface UIXRenderingContext

getLocaleContext

public abstract 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.

Specified by:
getLocaleContext in interface ImageContext
Specified by:
getLocaleContext in interface UIXRenderingContext

getResponseWriter

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

Specified by:
getResponseWriter in interface UIXRenderingContext

setResponseWriter

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

Specified by:
setResponseWriter in interface UIXRenderingContext

setDataObject

public void setDataObject(java.lang.String namespaceURI,
                          java.lang.String name,
                          DataObject dataObject)
Stores a data object on the context. Clients using this method should strongly consider whether their code might function more effectively by overriding getDataObject(), and, for their namespaces, dynamically instantiating DataObjects.

Parameters:
namespaceURI - the namespace of the data object
name - the namespace of the data object
dataObject - the data object

setDataObjectMap

public void setDataObjectMap(java.lang.String namespaceURI,
                             java.util.Map<java.lang.String,DataObject> dataObjectDict)
Registers a dictionary for use in retrieving and storing data objects for a single namespace. Any data objects previously registered for that namespace will be dropped. If the dictionary is null, all data objects for that namespace will be deleted.

Parameters:
namespaceURI - the namespace of the data object
dataObjectDict - a Map of data objects

getDataObject

public final 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. Then, it will look for DataObjects added with setDataObject(). Developers cannot override this method; they must override the 3-argument getDataObject().

Specified by:
getDataObject in interface UIXRenderingContext
Overrides:
getDataObject in class LogicalNodeRenderingContext
See Also:
#addDataProvider

getDataObject

public DataObject getDataObject(UIXRenderingContext context,
                                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. Then, it will look for DataObjects added with setDataObject().

Specified by:
getDataObject in interface UIXRenderingContext
Overrides:
getDataObject in class LogicalNodeRenderingContext
Since:
2.0.12

getProperty

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

Specified by:
getProperty in interface ImageContext
Specified by:
getProperty in interface UIXRenderingContext
Overrides:
getProperty in class RenderedNodeRenderingContext

getURLEncoder

public URLEncoder getURLEncoder()
This implementation returns an encoder that does no special encoding, and returns an empty string as the default URL.

Specified by:
getURLEncoder in interface UIXRenderingContext
Returns:
the encoder that must be used for form parameter names and URLs
See Also:
UIXRenderingContext.getURLEncoder()

setURLEncoder

public void setURLEncoder(URLEncoder urlEncoder)
This implementation returns an encoder that does no special encoding, and returns an empty string as the default URL.

See Also:
UIXRenderingContext.getURLEncoder()

getConfiguration

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

Specified by:
getConfiguration in interface ImageContext
Specified by:
getConfiguration in interface UIXRenderingContext

getFormEncoder

public FormEncoder getFormEncoder()
This implementation returns an encoder that does no special encoding.

Specified by:
getFormEncoder in interface UIXRenderingContext
Returns:
the encoder that must be used for form values and client parameters added by JavaScript.
See Also:
UIXRenderingContext.getFormEncoder()

setFormEncoder

public void setFormEncoder(FormEncoder formEncoder)
This implementation returns an encoder that does no special encoding.

See Also:
UIXRenderingContext.getFormEncoder()

getImageContext

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

Specified by:
getImageContext in interface UIXRenderingContext

getTranslatedValue

public java.lang.Object getTranslatedValue(java.lang.String key)
Returns a translated value from the skin's resource bundle. Logs a severe message if there is a MissingResourceException.

Specified by:
getTranslatedValue in interface UIXRenderingContext

getIcon

public org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName)
We'll look at the reading direction and append :rtl if needed to the name

Specified by:
getIcon in interface UIXRenderingContext
Parameters:
namespace -
iconName -
Returns:

getTranslatedString

public java.lang.String getTranslatedString(java.lang.String key)
Returns a translated String from the skin's resource bundle. Logs a severe message if there is a MissingResourceException.

Specified by:
getTranslatedString in interface UIXRenderingContext

getStyleClass

public java.lang.Object getStyleClass(java.lang.String key)
Specified by:
getStyleClass in interface UIXRenderingContext

getParentContext

public final UIXRenderingContext getParentContext()
Description copied from interface: UIXRenderingContext
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.

Specified by:
getParentContext in interface UIXRenderingContext

clone

public java.lang.Object clone()
Description copied from interface: UIXRenderingContext
Returns a clone of the RenderingContext.

Specified by:
clone in interface UIXRenderingContext
Overrides:
clone in class RenderedNodeRenderingContext

getVariableResolver

public final UIVariableResolver getVariableResolver()
Description copied from interface: UIXRenderingContext
gets the VariableResolver to use for this render cycle

Specified by:
getVariableResolver in interface UIXRenderingContext
See Also:
createVariableResolver()

createVariableResolver

protected UIVariableResolver createVariableResolver()
creates a variable resolver to use with this render cycle


getDefaultNodeStackSize

protected int getDefaultNodeStackSize()
Returns the default initial number of nodes in the stack of logical nodes.

Overrides:
getDefaultNodeStackSize in class RenderedNodeRenderingContext

getDefaultPropertyMapSize

protected int getDefaultPropertyMapSize()
Description copied from class: RenderedNodeRenderingContext
Returns the default size of the PropertyMap used to store properties on the RenderingContext.

The default for this property is relatively small.

Overrides:
getDefaultPropertyMapSize in class RenderedNodeRenderingContext


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