org.apache.myfaces.trinidad.skin

## Class Icon

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

-     public abstract class Icon
      extends Object

  An object which represents a customizable icon that is capable of rendering itself. Icons objects are registered with a Skin via the Skin.registerIcon() method and are retrieved by Renderers via Skin.getIcon(). Customizers can override icons declaratively in the skin css file.

  Icon implementations which are capable of providing an image representation of the icon should override getImageURI(), getImageWidth() and getImageHeight(). The default implementations of these methods return null, which is an acceptable default for Icons which do not make use of images (ie. for text-based Icon implementations).

  Version:
    $Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/skin/icon/Icon.java#0 $) $Date: 10-nov-2005.18:59:03 $

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ALIGN_KEY`
    `static String` | `EMBEDDED_KEY`
    `static String` | `HEIGHT_KEY`
    `static String` | `ID_KEY`
    `static String` | `INLINE_STYLE_KEY`
    `static String` | `SHORT_DESC_KEY`
    `static String` | `STYLE_CLASS_KEY`
    `static String` | `WIDTH_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Icon()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Integer` | `getImageHeight(RenderingContext arc)` Returns the height of the image.
    `Object` | `getImageURI(javax.faces.context.FacesContext context, RenderingContext arc)` Returns a URI to the image that is used as the icon's content.
    `Integer` | `getImageWidth(RenderingContext arc)` Returns the width of the image.
    `boolean` | `isNull()` Returns true if the icon is non-existent, and will render no content at all.
    `InputStream` | `openStream(javax.faces.context.FacesContext context, RenderingContext arc)` Returns an InputStream which provides access to the image data for image-based Icons.
    `abstract void` | `renderIcon(javax.faces.context.FacesContext context, RenderingContext arc, Map<String,? extends Object> attrs)` Renders the Icon.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SHORT_DESC_KEY

          public static final String SHORT_DESC_KEY

      See Also:
        Constant Field Values

    - #### ALIGN_KEY

          public static final String ALIGN_KEY

      See Also:
        Constant Field Values

    - #### WIDTH_KEY

          public static final String WIDTH_KEY

      See Also:
        Constant Field Values

    - #### HEIGHT_KEY

          public static final String HEIGHT_KEY

      See Also:
        Constant Field Values

    - #### EMBEDDED_KEY

          public static final String EMBEDDED_KEY

      See Also:
        Constant Field Values

    - #### ID_KEY

          public static final String ID_KEY

      See Also:
        Constant Field Values

    - #### STYLE_CLASS_KEY

          public static final String STYLE_CLASS_KEY

      See Also:
        Constant Field Values

    - #### INLINE_STYLE_KEY

          public static final String INLINE_STYLE_KEY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Icon

          public Icon()

  - ### Method Detail

    - #### renderIcon

          public abstract void renderIcon(javax.faces.context.FacesContext context,
                        RenderingContext arc,
                        Map<String,? extends Object> attrs)
                                   throws IOException

      Renders the Icon.
      Parameters:
        `context` - FacesContext
        `arc` - The RenderingContext for the current request.
        `attrs` - A Map which which provides access to values that might be useful to Icon implementations, such as "id" and "shortDesc".
      Throws:
        `IOException`

    - #### getImageURI

          public Object getImageURI(javax.faces.context.FacesContext context,
                           RenderingContext arc)

      Returns a URI to the image that is used as the icon's content. The default implementation of this method simply returns null, which indicates to the caller that no image representation of the Icon is available.
      Parameters:
        `context` - FacesContext
        `arc` - The RenderingContext for the current request.

    - #### getImageWidth

          public Integer getImageWidth(RenderingContext arc)

      Returns the width of the image. The default implementation of this method simply returns null, which indicates to the caller the width of the image is not known - or that the Icon does not provide an image representation.
      Parameters:
        `arc` - RenderingContext

    - #### getImageHeight

          public Integer getImageHeight(RenderingContext arc)

      Returns the height of the image. The default implementation of this method simply returns null, which indicates to the caller the height of the image is not known - or that the Icon does not provide an image representation.
      Parameters:
        `arc` - RenderingContext

    - #### openStream

          public InputStream openStream(javax.faces.context.FacesContext context,
                               RenderingContext arc)
                                 throws IOException

      Returns an InputStream which provides access to the image data for image-based Icons.
      Parameters:
        `context` - FacesContext
        `arc` - The RenderingContext for the current request.
      Throws:
        `IOException`

    - #### isNull

          public boolean isNull()

      Returns true if the icon is non-existent, and will render no content at all.

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