org.apache.myfaces.trinidad.skin

## Class SkinAddition

- java.lang.Object
- - org.apache.myfaces.trinidad.skin.SkinAddition

- All Implemented Interfaces:
    Comparable

      public class SkinAddition
      extends Object
      implements Comparable

  SkinAddition objects are used by custom component developers who have created custom components, and they need a way to 'push' in their own stylesheet and resource bundle for these components into some skin of their choosing, most likely the simple skin.

  A Skin object contains zero or more SkinAdditions. The SkinAdditions' stylesheets are merged into the Skin's own stylesheet. The SkinAdditions' resource bundle is looked at along with the Skin's own resource bundle when Skin's getTranslatedValue is called.

  If you want to 'push' your styles into a specific skin, then you would create a skin-addition in the trinidad-skins.xml file. You specify a <skin-addition>. The children are: <skin-id>, <style-sheet-name>, <bundle-name>, and <translation-source>. The <skin-id> is used to specify which skin you want to 'push' your stylesheet/resource bundle into. Most likely this is the simple.desktop skin. The other elements are used to create a SkinAddition object.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SkinAddition.Builder` convenience builder for SkinAddition does not support the deprecated ValueBinding for translationSource

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SkinAddition(Map<String,String> features)` Deprecated. Use builder to create a SkinAddition object.
    `SkinAddition(String styleSheetName)` Deprecated. Use builder to create a SkinAddition object.
    `SkinAddition(String styleSheetName, Map<String,String> features)` Deprecated. Use builder to create a SkinAddition object.
    `SkinAddition(String styleSheetName, String resourceBundleName)` Deprecated. Use builder to create a SkinAddition object.
    `SkinAddition(String styleSheetName, String resourceBundleName, Map<String,String> features)` Deprecated. Use builder to create a SkinAddition object.
    `SkinAddition(String styleSheetName, javax.faces.el.ValueBinding translationSourceValueBinding)` Deprecated. Use builder to create a SkinAddition object.
    `SkinAddition(String styleSheetName, javax.el.ValueExpression translationSourceValueExpression)` Deprecated. Use builder to create a SkinAddition object.
    `SkinAddition(String styleSheetName, javax.el.ValueExpression translationSourceValueExpression, Map<String,String> features)` Deprecated. Use builder to create a SkinAddition object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Object t)` Compares two skinning additions for the purposes of ordering.
    `boolean` | `equals(Object o)`
    `String` | `getResourceBundleName()` Gets the SkinAddition's resource bundle.
    `Map<String,String>` | `getSkinFeatures()` Gets any skin features added through the skin addition
    `String` | `getSkinId()` Gets the skin id to which this skin addition belongs to.
    `String` | `getStyleSheetName()` Gets the SkinAddition's style sheet name.
    `javax.faces.el.ValueBinding` | `getTranslationSourceValueBinding()` Deprecated.
    `javax.el.ValueExpression` | `getTranslationSourceValueExpression()` Gets the SkinAddition's translation source ValueExpresion.
    `int` | `hashCode()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SkinAddition

          @Deprecated
          public SkinAddition(String styleSheetName,
                                 String resourceBundleName)

      Deprecated. Use builder to create a SkinAddition object.
      Constructor takes a styleSheet name and a resourceBundle name.

    - #### SkinAddition

          @Deprecated
          public SkinAddition(String styleSheetName,
                                 javax.el.ValueExpression translationSourceValueExpression)

      Deprecated. Use builder to create a SkinAddition object.
      Constructor takes a styleSheet name and a translationSource ValueExpression.

    - #### SkinAddition

          @Deprecated
          public SkinAddition(String styleSheetName)

      Deprecated. Use builder to create a SkinAddition object.
      Constructor takes a styleSheet name. resource bundle name and translation source value expression will be null.

    - #### SkinAddition

          @Deprecated
          public SkinAddition(String styleSheetName,
                                 String resourceBundleName,
                                 Map<String,String> features)

      Deprecated. Use builder to create a SkinAddition object.
      Constructor takes a styleSheet name and a resourceBundle name.

    - #### SkinAddition

          @Deprecated
          public SkinAddition(String styleSheetName,
                                 javax.el.ValueExpression translationSourceValueExpression,
                                 Map<String,String> features)

      Deprecated. Use builder to create a SkinAddition object.
      Constructor takes a styleSheet name and a translationSource ValueExpression.

    - #### SkinAddition

          @Deprecated
          public SkinAddition(String styleSheetName,
                                 Map<String,String> features)

      Deprecated. Use builder to create a SkinAddition object.
      Constructor takes a styleSheet name. resource bundle name and translation source value expression will be null.

    - #### SkinAddition

          @Deprecated
          public SkinAddition(Map<String,String> features)

      Deprecated. Use builder to create a SkinAddition object.
      Constructor takes only features.

    - #### SkinAddition

          @Deprecated
          public SkinAddition(String styleSheetName,
                                 javax.faces.el.ValueBinding translationSourceValueBinding)

      Deprecated. Use builder to create a SkinAddition object.
      Constructor takes a styleSheet name and a translationSource ValueBinding. ValueBinding is deprecated, use ValueExpression for setting the translationSource

  - ### Method Detail

    - #### getSkinId

          public String getSkinId()

      Gets the skin id to which this skin addition belongs to.

    - #### getStyleSheetName

          public String getStyleSheetName()

      Gets the SkinAddition's style sheet name. Note that in order to avoid infinite call loop the implementation of getStylesheetName() in this class or sub classes should not call toString().

    - #### getResourceBundleName

          public String getResourceBundleName()

      Gets the SkinAddition's resource bundle. A skin cannot have both a resourceBundleName and a translation source value expression. If they do, then the resourceBundleName takes precedence. Note that in order to avoid infinite call loop the implementation of getResourceBundleName() in this class or sub classes should not call toString().

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getTranslationSourceValueExpression

          public javax.el.ValueExpression getTranslationSourceValueExpression()

      Gets the SkinAddition's translation source ValueExpresion. The ValueExpression can point to a Map or a ResourceBundle. Note: A skin cannot have both a resourceBundleName and a translation source value expression. If they do, then the resourceBundleName takes precedence.

    - #### getTranslationSourceValueBinding

          @Deprecated
          public javax.faces.el.ValueBinding getTranslationSourceValueBinding()

      Deprecated.
      Gets the SkinAddition's translation source ValueBinding. The ValueBinding can point to a Map or a ResourceBundle. Note: A skin cannot have both a resourceBundleName and a translation source value binding. If they do, then the resourceBundleName takes precedence.

    - #### getSkinFeatures

          public Map<String,String> getSkinFeatures()

      Gets any skin features added through the skin addition

    - #### compareTo

          public int compareTo(Object t)

      Compares two skinning additions for the purposes of ordering. Currently this method compares the stylesheet name. If both names are null, then they are considered equal. If one of the names is null and the other isn't, the null value is always less then the real value. Other then that the values will be returned according to the string's natural order.
      Specified by:
        `compareTo` in interface `Comparable`
      Parameters:
        `t` -
      Returns:
      Throws:
        `NullPointerException` - if t is null
        `ClassCastException` - id t is not an instance of StyleSheetAddition

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

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