de.caff.util.settings.swing

## Class SwingColorProperty

- java.lang.Object
- - de.caff.util.settings.AbstractBasicChangeableItem
  - - de.caff.util.settings.AbstractBasicLocalizableChangeableItem
    - - de.caff.util.settings.swing.AbstractBasicSimpleEditableChangeableItem
      - - de.caff.util.settings.swing.SwingColorProperty

- All Implemented Interfaces:
    ChangeableItem, Property<java.awt.Color>, EditableProperty, java.io.Serializable
  Direct Known Subclasses:
    SwingColorPreferenceProperty

      public class SwingColorProperty
      extends AbstractBasicSimpleEditableChangeableItem
      implements Property<java.awt.Color>

  Color property.
  Author:
    Rammi
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `autoSave` Save values automatically?
    `protected java.awt.Color` | `value` The color.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SwingColorProperty(java.lang.String basicName, java.lang.String baseTag, boolean autoSave, java.awt.Color defaultValue)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.swing.JMenuItem` | `createMenuItem(java.lang.String tag, java.awt.Color color, java.util.Locale l)` Create a menu entry which allows to switch to a given color.
    `EditorProvider` | `getEditorProvider(java.util.Locale l)` Get the editor components for editing this preference property.
    `java.awt.Color` | `getValue()` Get the color value,.
    `void` | `setValue(java.awt.Color value)` Set the color value.

    - ### Methods inherited from class de.caff.util.settings.AbstractBasicLocalizableChangeableItem

      `getBaseTag, getLabelString, getMenuString, getName, getString`

    - ### Methods inherited from class de.caff.util.settings.AbstractBasicChangeableItem

      `addValueChangeListener, addValueChangeListenerWeakly, firePropertyChange, fireValueChange, fireValueChange, fireValueChange, getBasicName, getPropertyName, removeValueChangeListener, removeValueChangeListenerWeakly`

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

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

    - ### Methods inherited from interface de.caff.util.settings.ChangeableItem

      `addValueChangeListener, addValueChangeListenerWeakly, removeValueChangeListener, removeValueChangeListenerWeakly`

    - ### Methods inherited from interface de.caff.util.settings.swing.EditableProperty

      `getName`

- - ### Field Detail

    - #### autoSave

          protected final boolean autoSave

      Save values automatically?

    - #### value

          protected java.awt.Color value

      The color.

  - ### Constructor Detail

    - #### SwingColorProperty

          public SwingColorProperty(@NotNull
                                    java.lang.String basicName,
                                    @NotNull
                                    java.lang.String baseTag,
                                    boolean autoSave,
                                    @NotNull
                                    java.awt.Color defaultValue)

      Constructor.
      Parameters:
        `basicName` - basic property name
        `baseTag` - basic I18n tag
        `autoSave` - do auto save?
        `defaultValue` - default value

  - ### Method Detail

    - #### getEditorProvider

          @NotNull
          public EditorProvider getEditorProvider(@Nullable
                                                           java.util.Locale l)

      Get the editor components for editing this preference property.
      Specified by:
        `getEditorProvider` in interface `EditableProperty`
      Parameters:
        `l` - locale used for i18n
      Returns:
        editor component

    - #### getValue

          public java.awt.Color getValue()

      Get the color value,.
      Specified by:
        `getValue` in interface `Property<java.awt.Color>`
      Returns:
        color value

    - #### setValue

          public void setValue(java.awt.Color value)

      Set the color value.
      Specified by:
        `setValue` in interface `Property<java.awt.Color>`
      Parameters:
        `value` - new color

    - #### createMenuItem

          public javax.swing.JMenuItem createMenuItem(@NotNull
                                                      java.lang.String tag,
                                                      @NotNull
                                                      java.awt.Color color,
                                                      @Nullable
                                                      java.util.Locale l)

      Create a menu entry which allows to switch to a given color.
      Parameters:
        `tag` - i18n tag to use for switching to color
        `color` - color to switch to
        `l` - locale to use
      Returns:
        menu item