org.apache.myfaces.trinidad.skin
Class Skin

java.lang.Object
  extended by org.apache.myfaces.trinidad.skin.Skin

public abstract class Skin
extends java.lang.Object

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 $
See Also:
SkinFactory

Constructor Summary
Skin()
           
 
Method Summary
abstract  void addSkinAddition(SkinAddition skinAddition)
          Adds a SkinAddition on this Skin.
abstract  java.lang.String getFamily()
          Returns the name of the skin "family" for this skin.
abstract  Icon getIcon(java.lang.String iconName)
          Our renderers call this to get the icon.
abstract  Icon getIcon(java.lang.String iconName, boolean resolveIcon)
          Returns an Icon object; can be a ReferenceIcon.
abstract  java.lang.String getId()
          Returns an string identifier which uniquely identies this Skin implementation.
abstract  java.lang.Object getProperty(java.lang.Object key)
          Retrieves a property that was set via a call to setProperty().
abstract  java.lang.String getRenderKitId()
          Returns the renderKitId for the Skin.
abstract  java.util.List<SkinAddition> getSkinAdditions()
          Gets a List of SkinAdditions that have been added on this Skin.
abstract  java.util.Map<java.lang.String,java.lang.String> getStyleClassMap(RenderingContext arc)
          Returns the style class map, or null if there is no map.
abstract  java.lang.String getStyleSheetDocumentId(RenderingContext arc)
          Returns the id of the Skin's stylesheet document.
abstract  java.lang.String getStyleSheetName()
          Returns the name of the style sheet for this Skin.
abstract  java.lang.String getTranslatedString(LocaleContext lContext, java.lang.String key)
          Returns a translated String in the LocaleContext's translation Locale.
abstract  java.lang.Object getTranslatedValue(LocaleContext lContext, java.lang.String key)
          Returns a translated value in the LocaleContext's translation Locale.
abstract  void registerIcon(java.lang.String iconName, Icon icon)
          Registers an Icon for the specified icon name.
abstract  void registerStyleSheet(java.lang.String styleSheetName)
          Deprecated. Use addSkinAddition(SkinAddition) instead.
abstract  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

Skin

public Skin()
Method Detail

getId

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

See Also:
SkinFactory.getSkin(javax.faces.context.FacesContext, java.lang.String)

getFamily

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


getRenderKitId

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


getStyleSheetDocumentId

public abstract java.lang.String getStyleSheetDocumentId(RenderingContext arc)
Returns the id of the Skin's stylesheet document.


getStyleClassMap

public abstract java.util.Map<java.lang.String,java.lang.String> getStyleClassMap(RenderingContext arc)
Returns the style class map, or null if there is no map. 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.


getStyleSheetName

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


getTranslatedString

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

Throws:
java.util.MissingResourceException

getTranslatedValue

public abstract java.lang.Object getTranslatedValue(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.

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

getIcon

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


getIcon

public abstract Icon getIcon(java.lang.String iconName,
                             boolean resolveIcon)
Returns an Icon object; can be a ReferenceIcon.

Parameters:
iconName - The name of the icon to retrieve. Cannot be null
Throws:
java.lang.NullPointerException - if iconName is null.

getProperty

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


setProperty

public abstract void setProperty(java.lang.Object key,
                                 java.lang.Object value)
Sets a value for the specified property key. Some Renderer implementations may store properties on the Skin instance to avoid having to re-compute Skin-specific values on each render.


registerIcon

public abstract void registerIcon(java.lang.String iconName,
                                  Icon icon)
Registers an Icon for the specified icon name.

Parameters:
iconName - The name of the icon. Cannot be null.
icon - The Icon to register.
Throws:
java.lang.NullPointerException - if iconName is null.

registerStyleSheet

@Deprecated
public abstract void registerStyleSheet(java.lang.String styleSheetName)
Deprecated. Use addSkinAddition(SkinAddition) instead.

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.

Parameters:
styleSheetName - The name of the style sheet which defines the extension's styles.
Throws:
java.lang.NullPointerException - if styleSheetName is null.
See Also:
addSkinAddition(SkinAddition)

addSkinAddition

public abstract void addSkinAddition(SkinAddition skinAddition)
Adds a SkinAddition on this Skin. You can call this method as many times as you like for the Skin, and it will add the SkinAddition to the list of SkinAdditions. However, it does not make sense to call this method more than once with the same SkinAddition object. This is meant for the skin-addition use-cases, where a custom component developer has a style sheet and/or resource bundle for their custom components, and they want the style sheet and/or resource bundle to work for this Skin and the children Skins. The stylesheets specified in the SkinAdditions will be merged with the Skin's own styles. The resource bundles specified in the SkinAdditions will be looked into if the translated key is not found in the Skin's own resource bundle during the call to getTranslatedString or getTranslatedValue.

Parameters:
skinAddition - The SkinAddition object to add to the Skin.
Throws:
java.lang.NullPointerException - if SkinAddition is null.

getSkinAdditions

public abstract java.util.List<SkinAddition> getSkinAdditions()
Gets a List of SkinAdditions that have been added on this Skin.

Returns:
List a List of SkinAdditions.


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