de.caff.gimmicks.swing

## Class VisibleState

- java.lang.Object
- - de.caff.gimmicks.swing.AbstractState
  - - de.caff.gimmicks.swing.VisibleState

- All Implemented Interfaces:
    State, ToolBarElement, Localizable, java.awt.event.ActionListener, java.util.EventListener, javax.swing.Action
  Direct Known Subclasses:
    AbstractToggleState

      public abstract class VisibleState
      extends AbstractState
      implements Localizable

  A visible state is a state with a possible label, different icons for different states and a possible tooltip text.
  Author:
    Rammi

- - ### Field Summary

    - ### Fields inherited from class de.caff.gimmicks.swing.AbstractState

      `manager, properties, propertyChangeSupport`

    - ### Fields inherited from interface de.caff.gimmicks.swing.State

      `ACTIVATION_PROPERTY, ACTIVE_ICON_PROPERTY, DISABLED_ICON_PROPERTY, ENABLE_PROPERTY, INACTIVE_ICON_PROPERTY, LABEL_TEXT_PROPERTY, POPUP_PROPERTY, TOOLTIP_TEXT_PROPERTY`

    - ### Fields inherited from interface javax.swing.Action

      `ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VisibleState()` Create a new abstract state.
    `VisibleState(java.lang.String baseTag)` Create a visible state from I18n settings.
    `VisibleState(java.lang.String labelResourceKey, java.lang.String tooltipResourceKey, javax.swing.Icon activeIcon)` Create a visible state with default icons.
    `VisibleState(java.lang.String labelResourceKey, java.lang.String tooltipResourceKey, javax.swing.Icon activeIcon, javax.swing.Icon inactiveIcon, javax.swing.Icon disabledIcon)` Create a visible state.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Locale` | `getLocale()` Get the locale.
    `void` | `setLocale(java.util.Locale l)` Set the locale.

    - ### Methods inherited from class de.caff.gimmicks.swing.AbstractState

      `actionPerformed, activate, addPropertyChangeListener, addPropertyChangeListener, addToToolBar, addToToolBar, deactivate, getValue, isActivated, isEnabled, isToggleEnabled, putValue, refresh, removePropertyChangeListener, removePropertyChangeListener, setEnabled, setManager, setProperty, showPopup`

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

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

    - ### Methods inherited from interface de.caff.gimmicks.swing.State

      `hasPopup`

- - ### Constructor Detail

    - #### VisibleState

          public VisibleState(java.lang.String labelResourceKey,
                              java.lang.String tooltipResourceKey,
                              javax.swing.Icon activeIcon,
                              javax.swing.Icon inactiveIcon,
                              javax.swing.Icon disabledIcon)

      Create a visible state.
      Parameters:
        `labelResourceKey` - resource key for labels and menu items
        `tooltipResourceKey` - resource key for tooltips
        `activeIcon` - icon to be displayed when state is active
        `inactiveIcon` - icon to be displayed when state is inactive
        `disabledIcon` - icon to be displayed when state is disabled (if `null` the Swing standard is used)

    - #### VisibleState

          public VisibleState()

      Create a new abstract state.

    - #### VisibleState

          public VisibleState(java.lang.String labelResourceKey,
                              java.lang.String tooltipResourceKey,
                              javax.swing.Icon activeIcon)

      Create a visible state with default icons. The inactive icon is the same as the active and the disabled icon is the standard disabled view.
      Parameters:
        `labelResourceKey` - resource key for labels and menu items
        `tooltipResourceKey` - resource key for tooltips
        `activeIcon` - icon to be displayed when state is active

    - #### VisibleState

          public VisibleState(@NotNull
                              java.lang.String baseTag)

      Create a visible state from I18n settings.
      Parameters:
        `baseTag` - I18n base tag

  - ### Method Detail

    - #### setLocale

          public void setLocale(java.util.Locale l)

      Set the locale.
      Specified by:
        `setLocale` in interface `Localizable`
      Parameters:
        `l` - locale to set.

    - #### getLocale

          public java.util.Locale getLocale()

      Get the locale.
      Specified by:
        `getLocale` in interface `Localizable`
      Returns:
        the locale