org.apache.myfaces.trinidadinternal.skin
Class SkinExtension

java.lang.Object
  extended by org.apache.myfaces.trinidad.skin.Skin
      extended by org.apache.myfaces.trinidadinternal.skin.SkinImpl
          extended by org.apache.myfaces.trinidadinternal.skin.SkinExtension
All Implemented Interfaces:
DocumentProviderSkin
Direct Known Subclasses:
CasablancaDesktopSkin, CasablancaPdaSkin, CasablancaPortletSkin, MinimalDesktopSkinExtension, MinimalPdaSkinExtension, MinimalPortletSkinExtension

public class SkinExtension
extends SkinImpl

A Skin which extends another Skin, possibly adding customizations.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/skin/SkinExtension.java#0 $) $Date: 10-nov-2005.18:58:55 $

Constructor Summary
SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin, java.lang.String id, java.lang.String family, java.lang.String renderKitId)
          Deprecated. Use the constructor that also contains styleSheetName
SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin, java.lang.String id, java.lang.String family, java.lang.String renderKitId, java.lang.String styleSheetName)
          Constructs a SkinExtension of id and family and renderKitId.
SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin, java.lang.String id, java.lang.String family, java.lang.String renderKitId, java.lang.String styleSheetName, org.apache.myfaces.trinidad.skin.SkinVersion version)
           
SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin, java.lang.String id, java.lang.String family, java.lang.String renderKitId, java.lang.String styleSheetName, java.lang.String resourceBundleName)
          Constructs a SkinExtension of id and family and renderKitId.
SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin, java.lang.String id, java.lang.String family, java.lang.String renderKitId, java.lang.String styleSheetName, java.lang.String resourceBundleName, org.apache.myfaces.trinidad.skin.SkinVersion version)
           
SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin, java.lang.String id, java.lang.String family, java.lang.String renderKitId, java.lang.String styleSheetName, javax.el.ValueExpression translationSourceValueExpression)
          Constructs a SkinExtension of id and family and renderKitId.
SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin, java.lang.String id, java.lang.String family, java.lang.String renderKitId, java.lang.String styleSheetName, javax.el.ValueExpression translationSourceValueExpression, org.apache.myfaces.trinidad.skin.SkinVersion version)
           
 
Method Summary
 org.apache.myfaces.trinidad.skin.Skin getBaseSkin()
          Returns the base Skin which this custom Skin "extends".
 java.lang.String getBundleName()
          Returns the name of the bundle for the SkinExtension.
 java.lang.String getFamily()
          Returns the name of the Skin family that this SkinExtension belongs to.
 org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName, boolean resolve)
          Override of Skin.getIcon() to look in the base skin for the icon if it isn't registered yet with this skin.
 java.lang.String getId()
          Returns the id of this custom Skin.
 java.lang.Object getProperty(java.lang.Object key)
          Try to pull a locally set property, if null pull a property from the base skin.
 java.lang.String getRenderKitId()
          Returns the name of the render-kit-id for this Skin.
 java.util.Map<java.lang.String,java.lang.String> getStyleClassMap(org.apache.myfaces.trinidad.context.RenderingContext arc)
          Returns the styleClassMap for this extension
 StyleSheetDocument getStyleSheetDocument(StyleContext context)
          Override of Skin.getStyleSheetDocument() which merges styles from the base Skin's style sheet and the SkinExtension's style sheet.
 java.lang.String getStyleSheetName()
          Returns the name of the style sheet for this Skin if one has been set
 java.lang.Object getTranslatedValue(org.apache.myfaces.trinidad.context.LocaleContext lContext, java.lang.String key)
          Override of Skin.getTranslatedValue() which supports pulling translations from Skin and if not found from the base Skin.
 javax.el.ValueExpression getTranslationSourceValueExpression()
          Returns the translation source ValueExpression for the SkinExtension.
 org.apache.myfaces.trinidad.skin.SkinVersion getVersion()
          Returns the SkinVersion object.
 void registerIcon(java.lang.String iconName, org.apache.myfaces.trinidad.skin.Icon icon)
          Override of Skin.registerIcon().
 void setBundleName(java.lang.String bundleName)
          Deprecated. Use the constructor that takes a resourceBundleName instead
 void setDirty(boolean dirty)
          Set the skin to be dirty.
 void setStyleSheetName(java.lang.String styleSheetName)
          Deprecated. Use the SkinExtension constructor that takes a styleSheetName instead.
 
Methods inherited from class org.apache.myfaces.trinidadinternal.skin.SkinImpl
addSkinAddition, getCachedTranslatedValue, getIcon, getSkinAdditions, getStyleSheetDocumentId, getTranslatedString, isDirty, putTranslatedValueInLocaleCache, registerStyleSheet, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkinExtension

public SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin,
                     java.lang.String id,
                     java.lang.String family,
                     java.lang.String renderKitId,
                     java.lang.String styleSheetName,
                     java.lang.String resourceBundleName)
Constructs a SkinExtension of id and family and renderKitId. It also sets the styleSheetname and a resourceBundle name.

Parameters:
baseSkin - The base Skin that this custom Skin "extends". If it is a Skin designed for "org.apache.myfaces.trinidad.desktop" render-kit-id, then its base skin should be SimpleDesktopSkin. If it is a Skin designed for "org.apache.myfaces.trinidad.pda" render-kit-id, then its base skin should be SimplePdaSkin. Must be non-null.
id - A string which can be used to uniquely identify the Skin . Must be non-null.
family - The Skin family name that this SkinExtension belongs to. For example, you might have a Skin that makes your pages look purple for the desktop renderkit and a Skin that makes your pages look purple for the pda renderkit. You can set the skin-family to "purple" in trinidad-config.xml, and the Skin with skin-family and render-kit-id match will be chosen. Must be non-null.
renderKitId - The render-kit-id that this Skin is designed for.
styleSheetName - The name of the stylesheet for this Skin.
resourceBundleName - The name of the resource bundle for this Skin to be used to translate strings that a renderer renders.
Throws:
java.lang.NullPointerException - if baseSkin, id, or family is null.

SkinExtension

public SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin,
                     java.lang.String id,
                     java.lang.String family,
                     java.lang.String renderKitId,
                     java.lang.String styleSheetName,
                     java.lang.String resourceBundleName,
                     org.apache.myfaces.trinidad.skin.SkinVersion version)

SkinExtension

public SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin,
                     java.lang.String id,
                     java.lang.String family,
                     java.lang.String renderKitId,
                     java.lang.String styleSheetName,
                     javax.el.ValueExpression translationSourceValueExpression)
Constructs a SkinExtension of id and family and renderKitId. It also sets the styleSheetname and a translation-source (instead of a resource bundle name).

Parameters:
baseSkin - The base Skin that this custom Skin "extends". If it is a Skin designed for "org.apache.myfaces.trinidad.desktop" render-kit-id, then its base skin should be SimpleDesktopSkin. If it is a Skin designed for "org.apache.myfaces.trinidad.pda" render-kit-id, then its base skin should be SimplePdaSkin. Must be non-null.
id - A string which can be used to uniquely identify the Skin . Must be non-null.
family - The Skin family name that this SkinExtension belongs to. For example, you might have a Skin that makes your pages look purple for the desktop renderkit and a Skin that makes your pages look purple for the pda renderkit. You can set the skin-family to "purple" in trinidad-config.xml, and the Skin with skin-family and render-kit-id match will be chosen. Must be non-null.
renderKitId - The render-kit-id that this Skin is designed for.
styleSheetName - The name of the stylesheet for this Skin.
translationSourceValueExpression - A ValueExpression that points to a translation source of type Map or ResourceBundle. This can be used instead of a resource bundle name.
Throws:
java.lang.NullPointerException - if baseSkin, id, or family is null.

SkinExtension

public SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin,
                     java.lang.String id,
                     java.lang.String family,
                     java.lang.String renderKitId,
                     java.lang.String styleSheetName,
                     javax.el.ValueExpression translationSourceValueExpression,
                     org.apache.myfaces.trinidad.skin.SkinVersion version)

SkinExtension

public SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin,
                     java.lang.String id,
                     java.lang.String family,
                     java.lang.String renderKitId,
                     java.lang.String styleSheetName)
Constructs a SkinExtension of id and family and renderKitId. It also sets the styleSheetname, but not the resource bundle name or translation source. This is the most frequently-used constructor.

Parameters:
baseSkin - The base Skin that this custom Skin "extends". If it is a Skin designed for "org.apache.myfaces.trinidad.desktop" render-kit-id, then its base skin should be SimpleDesktopSkin. If it is a Skin designed for "org.apache.myfaces.trinidad.pda" render-kit-id, then its base skin should be SimplePdaSkin. Must be non-null.
id - A string which can be used to uniquely identify the Skin . Must be non-null.
family - The Skin family name that this SkinExtension belongs to. For example, you might have a Skin that makes your pages look purple for the desktop renderkit and a Skin that makes your pages look purple for the pda renderkit. You can set the skin-family to "purple" in trinidad-config.xml, and the Skin with skin-family and render-kit-id match will be chosen. Must be non-null.
renderKitId - The render-kit-id that this Skin is designed for.
styleSheetName - The name of the stylesheet for this Skin.
Throws:
java.lang.NullPointerException - if baseSkin, id, or family is null.

SkinExtension

public SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin,
                     java.lang.String id,
                     java.lang.String family,
                     java.lang.String renderKitId,
                     java.lang.String styleSheetName,
                     org.apache.myfaces.trinidad.skin.SkinVersion version)

SkinExtension

public SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin,
                     java.lang.String id,
                     java.lang.String family,
                     java.lang.String renderKitId)
Deprecated. Use the constructor that also contains styleSheetName

Creates a Skin which extends the specified base Skin.

Parameters:
baseSkin - The base Skin that this custom Skin "extends". If it is a Skin designed for "org.apache.myfaces.trinidad.desktop" render-kit-id, then its base skin should be SimpleDesktopSkin. If it is a Skin designed for "org.apache.myfaces.trinidad.pda" render-kit-id, then its base skin should be SimplePdaSkin. Must be non-null.
id - A string which can be used to uniquely identify the Skin . Must be non-null.
family - The Skin family name that this SkinExtension belongs to. For example, you might have a Skin that makes your pages look purple for the desktop renderkit and a Skin that makes your pages look purple for the pda renderkit. You can set the skin-family to "purple" in trinidad-config.xml, and the Skin with skin-family and render-kit-id match will be chosen. Must be non-null.
renderKitId - The render-kit-id that this Skin is designed for.
Throws:
java.lang.NullPointerException - if baseSkin, id, or family is null.
Method Detail

getBaseSkin

public org.apache.myfaces.trinidad.skin.Skin getBaseSkin()
Returns the base Skin which this custom Skin "extends".


getId

public java.lang.String getId()
Returns the id of this custom Skin.

Overrides:
getId in class SkinImpl
See Also:
org.apache.myfaces.trinidadinternal.skin.SkinFactory#getSkin

getFamily

public java.lang.String getFamily()
Returns the name of the Skin family that this SkinExtension belongs to.

Overrides:
getFamily in class SkinImpl

getVersion

public org.apache.myfaces.trinidad.skin.SkinVersion getVersion()
Returns the SkinVersion object. If version was not set when creating the SkinExtension, this returns SkinVersion.EMPTY_SKIN_VERSION.

Overrides:
getVersion in class SkinImpl

getStyleSheetName

public java.lang.String getStyleSheetName()
Returns the name of the style sheet for this Skin if one has been set

Specified by:
getStyleSheetName in class SkinImpl
See Also:
setStyleSheetName(String)

getRenderKitId

public java.lang.String getRenderKitId()
Returns the name of the render-kit-id for this Skin.

Overrides:
getRenderKitId in class SkinImpl

getBundleName

public java.lang.String getBundleName()
Returns the name of the bundle for the SkinExtension. Note: A skin cannot have both a bundleName and a translation source value expression. If they do, then the bundlename takes precedence.

Specified by:
getBundleName in class SkinImpl

setBundleName

public void setBundleName(java.lang.String bundleName)
Deprecated. Use the constructor that takes a resourceBundleName instead

Returns the name of the bundle for this SkinExtension.


getTranslationSourceValueExpression

public javax.el.ValueExpression getTranslationSourceValueExpression()
Returns the translation source ValueExpression for the SkinExtension. Note: A skin cannot have both a bundleName and a translation source value expression. If they do, then the bundlename takes precedence. A translation source can be a map of keys/values or a ResourceBundle.

Specified by:
getTranslationSourceValueExpression in class SkinImpl

registerIcon

public void registerIcon(java.lang.String iconName,
                         org.apache.myfaces.trinidad.skin.Icon icon)
Override of Skin.registerIcon().

Overrides:
registerIcon in class SkinImpl
Parameters:
iconName - The name of the icon. Cannot be null.
icon - The Icon to register.

getStyleClassMap

public java.util.Map<java.lang.String,java.lang.String> getStyleClassMap(org.apache.myfaces.trinidad.context.RenderingContext arc)
Returns the styleClassMap for this extension

Overrides:
getStyleClassMap in class SkinImpl
Parameters:
arc - RenderingContext
Returns:
Map<String, String> It should be a map that contains the full style class name as the key, and the value could be a shortened style class name, or a portlet style class name, etc.

getTranslatedValue

public java.lang.Object getTranslatedValue(org.apache.myfaces.trinidad.context.LocaleContext lContext,
                                           java.lang.String key)
                                    throws java.util.MissingResourceException
Override of Skin.getTranslatedValue() which supports pulling translations from Skin and if not found from the base Skin.

Overrides:
getTranslatedValue in class SkinImpl
Parameters:
lContext - The LocaleContext which provides the translation Locale. Cannot be null.
key - The key of the translation to retrieve. Cannot be null.
Throws:
java.util.MissingResourceException - if the resource key cannot be found in the skin's bundle or the skin additions' bundles.

getProperty

public java.lang.Object getProperty(java.lang.Object key)
Try to pull a locally set property, if null pull a property from the base skin. This means you cannot set a local property to null and expect it to "null out" a property on the base skin.

Overrides:
getProperty in class SkinImpl

getIcon

public org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName,
                                                     boolean resolve)
Override of Skin.getIcon() to look in the base skin for the icon if it isn't registered yet with this skin.

Overrides:
getIcon in class SkinImpl
Parameters:
iconName - The name of the icon to retrieve. Cannot be null

setStyleSheetName

public void setStyleSheetName(java.lang.String styleSheetName)
Deprecated. Use the SkinExtension constructor that takes a styleSheetName instead.

Sets the name of the style sheet for this Skin.


getStyleSheetDocument

public StyleSheetDocument getStyleSheetDocument(StyleContext context)
Override of Skin.getStyleSheetDocument() which merges styles from the base Skin's style sheet and the SkinExtension's style sheet.

Specified by:
getStyleSheetDocument in interface DocumentProviderSkin
Overrides:
getStyleSheetDocument in class SkinImpl

setDirty

public void setDirty(boolean dirty)
Set the skin to be dirty. This will force the skin's css file to be reprocessed regardless of whether the css file has been modified or if the CHECK_FILE_MODIFICATION flag was set. The Skinning Framework sets the dirty flag back to false once it has reprocessed the skin.

Overrides:
setDirty in class SkinImpl


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