org.apache.myfaces.trinidadinternal.skin
Class SkinImpl

java.lang.Object
  extended by org.apache.myfaces.trinidad.skin.Skin
      extended by org.apache.myfaces.trinidadinternal.skin.SkinImpl
Direct Known Subclasses:
BaseSkin, SkinExtension, SkinNotAvailable

public abstract class SkinImpl
extends org.apache.myfaces.trinidad.skin.Skin

Defines the components (icons, styles, etc) which are used to implement a particular skin.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/skin/Skin.java#0 $) $Date: 10-nov-2005.18:58:54 $
Author:
The Oracle ADF Faces Team
See Also:
SkinFactory, org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext#getSkinFactory

Constructor Summary
SkinImpl()
           
 
Method Summary
protected abstract  java.lang.String getBundleName()
          Returns the name of the ResourceBundle for the Skin.
 java.lang.String getFamily()
          Returns the name of the skin "family" for this skin.
 org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName)
          Our renderers call this to get the icon.
 org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName, boolean resolveIcon)
          Returns an Icon object; can be a ReferenceIcon.
 java.lang.String getId()
          Returns an string identifier which uniquely identies this Skin implementation.
 java.lang.Object getProperty(java.lang.Object key)
          Retrieves a property that was set via a call to setProperty().
 java.lang.String getRenderKitId()
          Returns the renderKitId for the Skin.
 java.util.Map<java.lang.String,java.lang.String> getStyleClassMap(org.apache.myfaces.trinidad.context.RenderingContext arc)
          Returns the style class map, or null if there is no map.
 StyleSheetDocument getStyleSheetDocument(StyleContext context)
          Returns the StyleSheetDocument object which defines all of the styles for this Skin, including any styles that are contributed by UIExtensions.
abstract  java.lang.String getStyleSheetName()
          Returns the name of the XSS style sheet for this Skin.
 java.lang.String getTranslatedString(org.apache.myfaces.trinidad.context.LocaleContext lContext, java.lang.String key)
          Returns a translated String in the LocaleContext's translation Locale.
 java.lang.Object getTranslatedValue(org.apache.myfaces.trinidad.context.LocaleContext lContext, java.lang.String key)
          Returns a translated value in the LocaleContext's translation Locale.
 void registerIcon(java.lang.String iconName, org.apache.myfaces.trinidad.skin.Icon icon)
          Registers an Icon for the specified icon name.
 void registerStyleSheet(java.lang.String styleSheetName)
          Registers a style sheet which defines extension-specific styles.
 void setProperty(java.lang.Object key, java.lang.Object value)
          Sets a value for the specified property key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkinImpl

public SkinImpl()
Method Detail

getId

public java.lang.String getId()
Returns an string identifier which uniquely identies this Skin implementation. Skin implementations can be retrieved by id via SkinFactory.getSkin().

Specified by:
getId in class org.apache.myfaces.trinidad.skin.Skin
See Also:
org.apache.myfaces.trinidadinternal.skin.SkinFactory#getSkin

getFamily

public java.lang.String getFamily()
Returns the name of the skin "family" for this skin. The family name is used when specifying a preferred skin in trinidad-config.xml. This provides a way to refer to a group of related skin implementations while allowing the particular skin instance to be selected based on the current render-kit-id.

Specified by:
getFamily in class org.apache.myfaces.trinidad.skin.Skin

getRenderKitId

public java.lang.String getRenderKitId()
Returns the renderKitId for the Skin.

Specified by:
getRenderKitId in class org.apache.myfaces.trinidad.skin.Skin

getStyleSheetName

public abstract java.lang.String getStyleSheetName()
Returns the name of the XSS style sheet for this Skin.

Specified by:
getStyleSheetName in class org.apache.myfaces.trinidad.skin.Skin

getTranslatedString

public java.lang.String getTranslatedString(org.apache.myfaces.trinidad.context.LocaleContext lContext,
                                            java.lang.String key)
                                     throws java.util.MissingResourceException
Returns a translated String in the LocaleContext's translation Locale.

Specified by:
getTranslatedString in class org.apache.myfaces.trinidad.skin.Skin
Throws:
java.util.MissingResourceException

getTranslatedValue

public java.lang.Object getTranslatedValue(org.apache.myfaces.trinidad.context.LocaleContext lContext,
                                           java.lang.String key)
                                    throws java.util.MissingResourceException
Returns a translated value in the LocaleContext's translation Locale. This value may or may not be a String, and developers should avoid calling toString() unless absolutely necessary.

Specified by:
getTranslatedValue in class org.apache.myfaces.trinidad.skin.Skin
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.lang.NullPointerException - if lContext or key is null.
java.util.MissingResourceException

getBundleName

protected abstract java.lang.String getBundleName()
Returns the name of the ResourceBundle for the Skin.


getIcon

public org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName)
Our renderers call this to get the icon. This returns a renderable icon. (ReferenceIcons are resolved -- the real icon they point to is returned)

Specified by:
getIcon in class org.apache.myfaces.trinidad.skin.Skin

getIcon

public org.apache.myfaces.trinidad.skin.Icon getIcon(java.lang.String iconName,
                                                     boolean resolveIcon)
Returns an Icon object; can be a ReferenceIcon.

Specified by:
getIcon in class org.apache.myfaces.trinidad.skin.Skin
Parameters:
iconName - The name of the icon to retrieve. Cannot be null
Throws:
java.lang.NullPointerException - if iconName is null.

registerIcon

public void registerIcon(java.lang.String iconName,
                         org.apache.myfaces.trinidad.skin.Icon icon)
Registers an Icon for the specified icon name.

Specified by:
registerIcon in class org.apache.myfaces.trinidad.skin.Skin
Parameters:
iconName - The name of the icon. Cannot be null.
icon - The Icon to register.
Throws:
java.lang.NullPointerException - if iconName is null.

registerStyleSheet

public void registerStyleSheet(java.lang.String styleSheetName)
Registers a style sheet which defines extension-specific styles. The styles specified by this style sheet will be merged with the Skin's own styles. The full set of styles can be obtained by calling getStyleSheetDocument().

Specified by:
registerStyleSheet in class org.apache.myfaces.trinidad.skin.Skin
Parameters:
styleSheetName - The name of the style sheet which defines the extension's styles. This style sheet should be installed under the directory specified by Configuration.STYLES_DIRECTORY path.
Throws:
java.lang.NullPointerException - if styleSheetName is null.
See Also:
getStyleSheetDocument(org.apache.myfaces.trinidadinternal.style.StyleContext)

getStyleClassMap

public java.util.Map<java.lang.String,java.lang.String> getStyleClassMap(org.apache.myfaces.trinidad.context.RenderingContext arc)
Returns the style class map, or null if there is no map. Some StyleProvider implementations, such as the FileSystemStyleCache, automatically provide compressed versions style class names. The short style classes can be used instead of the full style class names to reduce the overall size of generated content.

Specified by:
getStyleClassMap in class org.apache.myfaces.trinidad.skin.Skin
Parameters:
arc - RenderingContext
Returns:
Map<String, String> The default implemention returns a map of full style class names to shortened style classes.

getStyleSheetDocument

public StyleSheetDocument getStyleSheetDocument(StyleContext context)
Returns the StyleSheetDocument object which defines all of the styles for this Skin, including any styles that are contributed by UIExtensions.


getProperty

public java.lang.Object getProperty(java.lang.Object key)
Retrieves a property that was set via a call to setProperty(). Some Renderer implementations may store properties on the Skin instance to avoid having to re-compute Skin-specific values on each render.

Specified by:
getProperty in class org.apache.myfaces.trinidad.skin.Skin

setProperty

public void setProperty(java.lang.Object key,
                        java.lang.Object value)
Sets a value for the specified property key.

Specified by:
setProperty in class org.apache.myfaces.trinidad.skin.Skin


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