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
Direct Known Subclasses:
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 $
Author:
The Oracle ADF Faces Team

Constructor Summary
SkinExtension(org.apache.myfaces.trinidad.skin.Skin baseSkin, java.lang.String id, java.lang.String family, java.lang.String renderKitId)
          Creates a Skin which extends the specified base Skin.
 
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 extension.
 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 XSS style sheet for this Skin if on 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 component providers as well as the base Skin.
 void registerIcon(java.lang.String iconName, org.apache.myfaces.trinidad.skin.Icon icon)
          Override of Skin.registerIcon().
 void setBundleName(java.lang.String bundleName)
          Returns the name of the bundle for the extension.
 void setStyleSheetName(java.lang.String styleSheetName)
          Sets the name of the style sheet for this Skin.
 
Methods inherited from class org.apache.myfaces.trinidadinternal.skin.SkinImpl
getIcon, getTranslatedString, 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)
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

getStyleSheetName

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

Specified by:
getStyleSheetName in class SkinImpl
See Also:
setStyleSheetName

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

Specified by:
getBundleName in class SkinImpl

setBundleName

public void setBundleName(java.lang.String bundleName)
Returns the name of the bundle for the extension.


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> The default implemention returns a map of full style class names to shortened style classes.

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 component providers as well as 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

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

Overrides:
getStyleSheetDocument in class SkinImpl


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