org.apache.myfaces.trinidadinternal.renderkit.core
Class CoreRenderingContext

java.lang.Object
  extended by org.apache.myfaces.trinidad.context.RenderingContext
      extended by org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderingContext

public class CoreRenderingContext
extends org.apache.myfaces.trinidad.context.RenderingContext


Field Summary
static java.lang.String EMPTY_STYLE_CLASS
          String marker used to indicate the style class is empty and can be ignored.
 
Constructor Summary
CoreRenderingContext()
           
 
Method Summary
 void clearFormData()
           
 org.apache.myfaces.trinidad.context.RequestContext.Accessibility getAccessibilityMode()
           
 org.apache.myfaces.trinidad.context.AccessibilityProfile getAccessibilityProfile()
           
 org.apache.myfaces.trinidad.context.Agent getAgent()
           
protected  java.lang.String getDefaultSkinFamily()
          Return the default skin family, which is "casablanca" for the core renderkit.
 javax.faces.context.FacesContext getFacesContext()
          Cached access to FacesContext.
 org.apache.myfaces.trinidad.context.FormData getFormData()
          This can return null if there is no form data
 org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName)
           
 org.apache.myfaces.trinidad.context.LocaleContext getLocaleContext()
           
 java.lang.String getOutputMode()
           
 org.apache.myfaces.trinidad.context.PartialPageContext getPartialPageContext()
           
 java.util.Map<java.lang.Object,java.lang.Object> getProperties()
           
 org.apache.myfaces.trinidad.context.RequestContext getRequestContext()
          Cached access to RequestContext
 org.apache.myfaces.trinidad.skin.Skin getRequestMapSkin()
          Returns the skin that is requested on the request map if the exact skin exists.
 java.lang.Object getRequestMapSkinId(javax.faces.context.FacesContext facesContext)
          Look on the requestMap for "org.apache.myfaces.trinidad.skin.id", and return the skin id.
 org.apache.myfaces.trinidad.skin.Skin getSkin()
           
 java.util.Map<java.lang.String,java.lang.String> getSkinResourceKeyMap()
          Get the _skinResourceKeyMap Map.
protected  java.lang.String getSkinResourceMappedKey(java.lang.String key)
           
 java.lang.String getStyleClass(java.lang.String styleClass)
           
 StyleContext getStyleContext()
          Get an interface that can be used for style lookups and generation.
 org.apache.myfaces.trinidad.style.Styles getStyles()
          Return the Styles object that is attached to this RenderingContext.
static java.lang.String getTemporaryDirectory(javax.faces.context.FacesContext fContext)
          Get the directory for temporary files.
 TrinidadAgent getTrinidadAgent()
          Typesafe accessor for the TrinidadAgent APIs.
 boolean isAnimationEnabled()
           
 boolean isDefaultLinkStyleDisabled()
           
 boolean isLinkDisabled()
           
 boolean isRequestMapStyleSheetIdAndSkinEqual(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.skin.Skin requestedSkin)
          This helps figure out if the portlet producer can share the portlet consumer's stylesheet.
 boolean isRightToLeft()
           
 void setDefaultLinkStyleDisabled(boolean isDisabled)
          Called by link containers prior to rendering their children in order to suppress the rendering of the default link style class (.OraLink).
 void setFormData(org.apache.myfaces.trinidad.context.FormData formData)
           
 void setLinkDisabled(boolean isDisabled)
          Called by link containers to force a link to render as disabled Important: Each call to setLinkDisabled(true) must be followed by a matching call to setLinkDisabled(false).
 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.
 void setStyleMap(java.util.Map<java.lang.String,java.lang.String> mapping)
          Store a map that provides abbreviations of styles.
 
Methods inherited from class org.apache.myfaces.trinidad.context.RenderingContext
attach, getCurrentClientId, getCurrentInstance, getTranslatedString, release, setCurrentClientId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_STYLE_CLASS

public static final java.lang.String EMPTY_STYLE_CLASS
String marker used to indicate the style class is empty and can be ignored.

See Also:
Constant Field Values
Constructor Detail

CoreRenderingContext

public CoreRenderingContext()
Method Detail

getFacesContext

public final javax.faces.context.FacesContext getFacesContext()
Cached access to FacesContext.


getRequestContext

public final org.apache.myfaces.trinidad.context.RequestContext getRequestContext()
Cached access to RequestContext


isDefaultLinkStyleDisabled

public boolean isDefaultLinkStyleDisabled()

setDefaultLinkStyleDisabled

public void setDefaultLinkStyleDisabled(boolean isDisabled)
Called by link containers prior to rendering their children in order to suppress the rendering of the default link style class (.OraLink). Most link containers (like tabBar, globalHeader) provide their own style classes - the default OraLink style class ends up getting in the way. Important: Each call to setDefaultLinkStyleClassDisabled(true) must be followed by a matching call to setDefaultLinkStyleClassDisabled(false).


isLinkDisabled

public boolean isLinkDisabled()

setLinkDisabled

public void setLinkDisabled(boolean isDisabled)
Called by link containers to force a link to render as disabled Important: Each call to setLinkDisabled(true) must be followed by a matching call to setLinkDisabled(false).


getProperties

public java.util.Map<java.lang.Object,java.lang.Object> getProperties()
Specified by:
getProperties in class org.apache.myfaces.trinidad.context.RenderingContext

getAgent

public org.apache.myfaces.trinidad.context.Agent getAgent()
Specified by:
getAgent in class org.apache.myfaces.trinidad.context.RenderingContext

getTrinidadAgent

public TrinidadAgent getTrinidadAgent()
Typesafe accessor for the TrinidadAgent APIs.


isRightToLeft

public boolean isRightToLeft()
Specified by:
isRightToLeft in class org.apache.myfaces.trinidad.context.RenderingContext

getOutputMode

public java.lang.String getOutputMode()
Specified by:
getOutputMode in class org.apache.myfaces.trinidad.context.RenderingContext

getAccessibilityMode

public org.apache.myfaces.trinidad.context.RequestContext.Accessibility getAccessibilityMode()
Specified by:
getAccessibilityMode in class org.apache.myfaces.trinidad.context.RenderingContext

getAccessibilityProfile

public org.apache.myfaces.trinidad.context.AccessibilityProfile getAccessibilityProfile()
Specified by:
getAccessibilityProfile in class org.apache.myfaces.trinidad.context.RenderingContext

isAnimationEnabled

public boolean isAnimationEnabled()
Specified by:
isAnimationEnabled in class org.apache.myfaces.trinidad.context.RenderingContext

getFormData

public org.apache.myfaces.trinidad.context.FormData getFormData()
This can return null if there is no form data

Specified by:
getFormData in class org.apache.myfaces.trinidad.context.RenderingContext

setFormData

public void setFormData(org.apache.myfaces.trinidad.context.FormData formData)
Specified by:
setFormData in class org.apache.myfaces.trinidad.context.RenderingContext

clearFormData

public void clearFormData()
Specified by:
clearFormData in class org.apache.myfaces.trinidad.context.RenderingContext

getSkin

public org.apache.myfaces.trinidad.skin.Skin getSkin()
Specified by:
getSkin in class org.apache.myfaces.trinidad.context.RenderingContext

getStyles

public org.apache.myfaces.trinidad.style.Styles getStyles()
Return the Styles object that is attached to this RenderingContext. You can use the Styles object to retrieve a map of the skin selectors and their css properties, already resolved for this specific request. A skin has selectors for all agents, locales, etc., and there might be blocks for ie-only or gecko-only or rtl, etc., and the resolved styles are styles for the specific request (agent, locale, aliases are merged, etc).

Overrides:
getStyles in class org.apache.myfaces.trinidad.context.RenderingContext
Returns:

getStyleContext

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


getLocaleContext

public org.apache.myfaces.trinidad.context.LocaleContext getLocaleContext()
Specified by:
getLocaleContext in class org.apache.myfaces.trinidad.context.RenderingContext

getPartialPageContext

public org.apache.myfaces.trinidad.context.PartialPageContext getPartialPageContext()
Specified by:
getPartialPageContext in class org.apache.myfaces.trinidad.context.RenderingContext

getStyleClass

public java.lang.String getStyleClass(java.lang.String styleClass)
Specified by:
getStyleClass in class org.apache.myfaces.trinidad.context.RenderingContext

getIcon

public org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName)
Specified by:
getIcon in class org.apache.myfaces.trinidad.context.RenderingContext

setStyleMap

public void setStyleMap(java.util.Map<java.lang.String,java.lang.String> mapping)
Store a map that provides abbreviations of styles.


setSkinResourceKeyMap

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

Specified by:
setSkinResourceKeyMap in class org.apache.myfaces.trinidad.context.RenderingContext

getSkinResourceKeyMap

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

Specified by:
getSkinResourceKeyMap in class org.apache.myfaces.trinidad.context.RenderingContext

getSkinResourceMappedKey

protected java.lang.String getSkinResourceMappedKey(java.lang.String key)

getDefaultSkinFamily

protected java.lang.String getDefaultSkinFamily()
Return the default skin family, which is "casablanca" for the core renderkit.


getRequestMapSkin

public org.apache.myfaces.trinidad.skin.Skin getRequestMapSkin()
Returns the skin that is requested on the request map if the exact skin exists. This only does something if the outputMode is portlet. Otherwise it returns null.

If we are in a portlet, then we might need to recalculate the skin. The portal container might have its own skin that it wants us (the producer) to use instead of what we picked based on the skin-family and render-kit-id. If it does, it will send the skin-id and the skin's styleSheetDocument id in the request map.

If we have the skin with that id and the stylesheetdocument's id match, then we return that skin (but we won't compress the style classes so they won't clash with the consumer's style classes which should be compressed). If we have the skin but the stylesheetdocument ids do not match, we still return that skin; else we return null, indicating that there is no requestMap skin that exists.

Returns:
null if there is no local skin that matches the requestMap skin, if any. skin that is requested to be used on the requestMap if we can find that exact skin.

getRequestMapSkinId

public java.lang.Object getRequestMapSkinId(javax.faces.context.FacesContext facesContext)
Look on the requestMap for "org.apache.myfaces.trinidad.skin.id", and return the skin id. This is for clients who want to send to the server the skin id via a request scope rather // than using the trinidad-config.xml's skin-family. The examples are the // design time and a portal container.

Parameters:
facesContext -
Returns:
the skin id that is on the request map.

isRequestMapStyleSheetIdAndSkinEqual

public boolean isRequestMapStyleSheetIdAndSkinEqual(javax.faces.context.FacesContext context,
                                                    org.apache.myfaces.trinidad.skin.Skin requestedSkin)
This helps figure out if the portlet producer can share the portlet consumer's stylesheet.

Parameters:
context -
requestedSkin - The skin that the portlet consumer wants the producer to share.
Returns:
true if the skin stylesheet id parameter on the request map is equal to the requestedSkin's stylesheetId.

getTemporaryDirectory

public static java.lang.String getTemporaryDirectory(javax.faces.context.FacesContext fContext)
Get the directory for temporary files.



Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.