de.caff.util.settings.swing

## Class EnumCheckedProxyEditorProvider<E>

- java.lang.Object
- - de.caff.util.settings.swing.EnumCheckedProxyEditorProvider<E>

- Type Parameters:
    `E` - enum type
  All Implemented Interfaces:
    EditorProvider, java.beans.PropertyChangeListener, java.util.EventListener

      public class EnumCheckedProxyEditorProvider<E>
      extends java.lang.Object
      implements EditorProvider, java.beans.PropertyChangeListener

  A proxy editor provider which is toggled by an enu,.
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EnumCheckedProxyEditorProvider(javax.swing.ButtonGroup buttonGroup, SwingEnumProperty<E> enumProperty, EnumValue<E> onValue, EditorProvider baseEditorProvider)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDescription()` Get a description for the property used.
    `javax.swing.JComponent` | `getEditor()` Get an component for editing .
    `javax.swing.JComponent` | `getLabel()` Get a label component for this editor.
    `java.lang.String` | `getLabelText()` Get the label text.
    `java.lang.String` | `getTitleText()` Get a title text for this editor component.
    `java.lang.String` | `getToolTipText()` Get a tool tip string for this editor component.
    `void` | `goodBye()` Called when the editor provider is no longer used.
    `boolean` | `isValidValue()` Is the value in the editor component valid?
    `void` | `propertyChange(java.beans.PropertyChangeEvent evt)` This method gets called when a bound property is changed.
    `void` | `reset()` Reset the value in the editor to the basic value.
    `void` | `save()` Set the basic value from the editor.

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

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

- - ### Constructor Detail

    - #### EnumCheckedProxyEditorProvider

          public EnumCheckedProxyEditorProvider(@NotNull
                                                javax.swing.ButtonGroup buttonGroup,
                                                @NotNull
                                                SwingEnumProperty<E> enumProperty,
                                                @NotNull
                                                EnumValue<E> onValue,
                                                @NotNull
                                                EditorProvider baseEditorProvider)

      Constructor.
      Parameters:
        `buttonGroup` - button group for radio buttons
        `enumProperty` - enum property holding the enum which toggles this proxy
        `onValue` - enum value which toggles this proxy
        `baseEditorProvider` - base editor provider

  - ### Method Detail

    - #### propertyChange

          public void propertyChange(java.beans.PropertyChangeEvent evt)

      This method gets called when a bound property is changed.
      Specified by:
        `propertyChange` in interface `java.beans.PropertyChangeListener`
      Parameters:
        `evt` - A PropertyChangeEvent object describing the event source and the property that has changed.

    - #### getLabelText

          @Nullable
          public java.lang.String getLabelText()

      Get the label text.
      Specified by:
        `getLabelText` in interface `EditorProvider`
      Returns:
        label text

    - #### getLabel

          @Nullable
          public javax.swing.JComponent getLabel()

      Get a label component for this editor. If the returned component is null the `editor component` is inserted without a label.
      Specified by:
        `getLabel` in interface `EditorProvider`
      Returns:
        something used as a label component, or `null`

    - #### getTitleText

          @Nullable
          public java.lang.String getTitleText()

      Get a title text for this editor component.
      Specified by:
        `getTitleText` in interface `EditorProvider`
      Returns:
        a title text or `null` if a title makes no sense

    - #### getToolTipText

          @Nullable
          public java.lang.String getToolTipText()

      Get a tool tip string for this editor component.
      Specified by:
        `getToolTipText` in interface `EditorProvider`
      Returns:
        tooltip text or `null` if no tooltip is used

    - #### getDescription

          @Nullable
          public java.lang.String getDescription()

      Get a description for the property used.
      Specified by:
        `getDescription` in interface `EditorProvider`
      Returns:
        description, possibly multi-line

    - #### getEditor

          @NotNull
          public javax.swing.JComponent getEditor()

      Get an component for editing .
      Specified by:
        `getEditor` in interface `EditorProvider`
      Returns:
        editor component, use non-editing components like labels for fix properties

    - #### isValidValue

          public boolean isValidValue()

      Is the value in the editor component valid?
      Specified by:
        `isValidValue` in interface `EditorProvider`
      Returns:
        `true` if the value is valid
        `false` otherwise

    - #### reset

          public void reset()

      Reset the value in the editor to the basic value.
      Specified by:
        `reset` in interface `EditorProvider`

    - #### save

          public void save()

      Set the basic value from the editor.
      Specified by:
        `save` in interface `EditorProvider`

    - #### goodBye

          public void goodBye()

      Called when the editor provider is no longer used.
      Specified by:
        `goodBye` in interface `EditorProvider`