de.caff.util.settings.swing

## Class SwingFormattedStringProperty<T>

- java.lang.Object
- - de.caff.util.settings.AbstractBasicChangeableItem
  - - de.caff.util.settings.AbstractBasicLocalizableChangeableItem
    - - de.caff.util.settings.swing.AbstractBasicSimpleEditableChangeableItem
      - - de.caff.util.settings.swing.SwingFormattedStringProperty<T>

- All Implemented Interfaces:
    ChangeableItem, Property<T>, EditableProperty, java.io.Serializable

      public class SwingFormattedStringProperty<T>
      extends AbstractBasicSimpleEditableChangeableItem
      implements Property<T>

  Property represented as a one-line string with a defined format.
  Author:
    Rammi
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_ROWS` Default number of rows displayed in editor.
    `protected T` | `value` The value.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SwingFormattedStringProperty(java.lang.String basicName, java.lang.String baseTag, javax.swing.JFormattedTextField.AbstractFormatter formatter)` Constructor.
    `SwingFormattedStringProperty(java.lang.String basicName, java.lang.String baseTag, javax.swing.JFormattedTextField.AbstractFormatter formatter, boolean autoSave, T value, int columns)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getColumns()` Get the number of columns to be displayed.
    `EditorProvider` | `getEditorProvider(java.util.Locale l)` Get the editor components for editing this preference property.
    `javax.swing.JFormattedTextField.AbstractFormatter` | `getFormatter()` Get the formatter to use.
    `T` | `getValue()` Get the value.
    `void` | `setValue(T value)` Set the 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

    - #### DEFAULT_ROWS

          public static final int DEFAULT_ROWS

      Default number of rows displayed in editor.
      See Also:
        Constant Field Values

    - #### value

          protected T value

      The value.

  - ### Constructor Detail

    - #### SwingFormattedStringProperty

          public SwingFormattedStringProperty(@NotNull
                                              java.lang.String basicName,
                                              @NotNull
                                              java.lang.String baseTag,
                                              @NotNull
                                              javax.swing.JFormattedTextField.AbstractFormatter formatter)

      Constructor.
      Parameters:
        `basicName` - basic name
        `baseTag` - base tag
        `formatter` - formatter defining the expected format of the string

    - #### SwingFormattedStringProperty

          public SwingFormattedStringProperty(@NotNull
                                              java.lang.String basicName,
                                              @NotNull
                                              java.lang.String baseTag,
                                              @NotNull
                                              javax.swing.JFormattedTextField.AbstractFormatter formatter,
                                              boolean autoSave,
                                              T value,
                                              int columns)

      Constructor.
      Parameters:
        `basicName` - basic name
        `baseTag` - base tag
        `formatter` - formatter defining the expected format of the string
        `autoSave` - do auto save?
        `value` - initial value
        `columns` - columns to display

  - ### 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

    - #### getColumns

          public int getColumns()

      Get the number of columns to be displayed.
      Returns:
        number of displayed columns

    - #### getValue

          public T getValue()

      Get the value.
      Specified by:
        `getValue` in interface `Property<T>`
      Returns:
        value

    - #### getFormatter

          @NotNull
          public javax.swing.JFormattedTextField.AbstractFormatter getFormatter()

      Get the formatter to use.
      Returns:
        formatter

    - #### setValue

          public void setValue(T value)

      Set the value.
      Specified by:
        `setValue` in interface `Property<T>`
      Parameters:
        `value` - string value