de.caff.util.ui

## Class UIResourceHandler

- java.lang.Object
- - de.caff.util.ui.UIResourceHandler

- Direct Known Subclasses:
    ArrayUIResourceHandler, BooleanUIResourceHandler, BorderUIResourceHandler, CharacterUIResourceHandler, ClassUIResourceHandler, ColorUIResourceHandler, DimensionUIResourceHandler, FloatUIResourceHandler, FontUIResourceHandler, GradientUIResourceHandler, InsetsUIResourceHandler, IntegerUIResourceHandler, LongUIResourceHandler, MethodUIResourceHandler, StringUIResourceHandler

      public abstract class UIResourceHandler
      extends java.lang.Object

  Handler for UI Resource.
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `UIResourceHandler(java.lang.String id)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.String` | `fromValue(java.lang.Object value)` Get the string representation of a value.
    `abstract java.lang.Class<?>` | `getHandledClass()` Get the class handled by this resource handler.
    `java.lang.String` | `getID()` Get the id of this resource.
    `java.lang.String` | `getValue(javax.swing.UIDefaults defaults)` Get the string representation of the value of the resource.
    `boolean` | `setValue(UIResourceCollection uirc, java.lang.String value)` Extract the value from a string representation,
    `protected abstract java.lang.Object` | `toValue(java.lang.String text)` Convert a textual representation of a value to a value.

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

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

- - ### Constructor Detail

    - #### UIResourceHandler

          protected UIResourceHandler(java.lang.String id)

      Constructor.
      Parameters:
        `id` - ID of resource

  - ### Method Detail

    - #### getID

          public java.lang.String getID()

      Get the id of this resource.
      Returns:
        the id

    - #### getValue

          public java.lang.String getValue(javax.swing.UIDefaults defaults)

      Get the string representation of the value of the resource.
      Parameters:
        `defaults` - the UI defaults from where the value is read
      Returns:
        the value in textual form

    - #### setValue

          public boolean setValue(UIResourceCollection uirc,
                                  java.lang.String value)

      Extract the value from a string representation,
      Parameters:
        `uirc` - UI resource collection
        `value` - value in textual form
      Returns:
        `true` if it was possible to extract the value from the text, `false` otherwise

    - #### toValue

          protected abstract java.lang.Object toValue(java.lang.String text)

      Convert a textual representation of a value to a value.
      Parameters:
        `text` - textual representation
      Returns:
        the value or `null` if the text cannot be converted
      See Also:
        `fromValue(Object)`

    - #### fromValue

          protected java.lang.String fromValue(java.lang.Object value)

      Get the string representation of a value.
      Parameters:
        `value` - the UI value
      Returns:
        the value in textual form
      See Also:
        `toValue(String)`

    - #### getHandledClass

          public abstract java.lang.Class<?> getHandledClass()

      Get the class handled by this resource handler.
      Returns:
        handled class