de.caff.util.settings

## Class AbstractBasicChangeableItem

- java.lang.Object
- - de.caff.util.settings.AbstractBasicChangeableItem

- All Implemented Interfaces:
    ChangeableItem, java.io.Serializable
  Direct Known Subclasses:
    AbstractBasicLocalizableChangeableItem, BasicPhysicalLengthPreferenceProperty, BoundsPreferenceProperty, SimpleBooleanProperty, SimpleByteProperty, SimpleCharProperty, SimpleDirectoryPreferenceProperty, SimpleDoubleProperty, SimpleFloatProperty, SimpleIntegerProperty, SimpleLongProperty, SimpleNonNullProperty, SimpleNullableProperty, SimpleShortProperty, SizePreferenceProperty

      public abstract class AbstractBasicChangeableItem
      extends java.lang.Object
      implements ChangeableItem, java.io.Serializable

  Basic implementation of a preference property.

  It takes care of registering the listeners and provides a name used to store and retrieve the property value. It provides several `firePropertyChange()` method. Each implementing class has to call one of these methods whenever the underlying value is changed.

  Author:
    Rammi
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractBasicChangeableItem(java.lang.String basicName)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addValueChangeListener(java.beans.PropertyChangeListener listener)` Add a listener which will be called for all value changes.
    `void` | `addValueChangeListenerWeakly(java.beans.PropertyChangeListener listener)` Add a listener which will be called for all value changes.
    `protected void` | `firePropertyChange(java.beans.PropertyChangeEvent evt)` Fire a property change.
    `protected void` | `fireValueChange(java.lang.String propertyName, boolean oldValue, boolean newValue)` Fire a value property change for a boolean value.
    `protected void` | `fireValueChange(java.lang.String propertyName, int oldValue, int newValue)` Fire a value property change for a integer value.
    `protected void` | `fireValueChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)` Fire a generic value property change.
    `protected java.lang.String` | `getBasicName()` Get the basic name of the property.
    `java.lang.String` | `getPropertyName()` Get the name of the property.
    `void` | `removeValueChangeListener(java.beans.PropertyChangeListener listener)` Remove a listener which will be called for all value changes.
    `void` | `removeValueChangeListenerWeakly(java.beans.PropertyChangeListener listener)` Remove a weakly referenced listener which will be called for all value changes.

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

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

- - ### Constructor Detail

    - #### AbstractBasicChangeableItem

          protected AbstractBasicChangeableItem(@NotNull
                                                java.lang.String basicName)

      Constructor. Construct a property with the given name or name prefix.
      Parameters:
        `basicName` - name or name prefix

  - ### Method Detail

    - #### getBasicName

          @NotNull
          protected java.lang.String getBasicName()

      Get the basic name of the property. This may be the complete name or a common prefix.
      Returns:
        the basic name

    - #### firePropertyChange

          protected void firePropertyChange(java.beans.PropertyChangeEvent evt)

      Fire a property change.
      Parameters:
        `evt` - property change event

    - #### addValueChangeListener

          public void addValueChangeListener(@NotNull
                                             java.beans.PropertyChangeListener listener)

      Add a listener which will be called for all value changes.
      Specified by:
        `addValueChangeListener` in interface `ChangeableItem`
      Parameters:
        `listener` - value change listener to add
      See Also:
        `addValueChangeListenerWeakly(java.beans.PropertyChangeListener)`

    - #### addValueChangeListenerWeakly

          public void addValueChangeListenerWeakly(@NotNull
                                                   java.beans.PropertyChangeListener listener)

      Add a listener which will be called for all value changes. The listener is registered with a weak reference, allowing it to be freed if this is the only reference.

      If you want to remove the listener please use the corresponding `removeValueChangeListenerWeakly(java.beans.PropertyChangeListener)` method.

      Specified by:
        `addValueChangeListenerWeakly` in interface `ChangeableItem`
      Parameters:
        `listener` - value change listener to add
      See Also:
        `addValueChangeListener(java.beans.PropertyChangeListener)`

    - #### removeValueChangeListener

          public void removeValueChangeListener(@NotNull
                                                java.beans.PropertyChangeListener listener)

      Remove a listener which will be called for all value changes.
      Specified by:
        `removeValueChangeListener` in interface `ChangeableItem`
      Parameters:
        `listener` - value change listener to remove
      See Also:
        `removeValueChangeListenerWeakly(java.beans.PropertyChangeListener)`

    - #### removeValueChangeListenerWeakly

          public void removeValueChangeListenerWeakly(@NotNull
                                                      java.beans.PropertyChangeListener listener)

      Remove a weakly referenced listener which will be called for all value changes.
      Specified by:
        `removeValueChangeListenerWeakly` in interface `ChangeableItem`
      Parameters:
        `listener` - value change listener to remove
      See Also:
        `removeValueChangeListener(java.beans.PropertyChangeListener)`

    - #### fireValueChange

          protected void fireValueChange(java.lang.String propertyName,
                                         java.lang.Object oldValue,
                                         java.lang.Object newValue)

      Fire a generic value property change.
      Parameters:
        `propertyName` - property name
        `oldValue` - old value
        `newValue` - new value

    - #### fireValueChange

          protected void fireValueChange(java.lang.String propertyName,
                                         boolean oldValue,
                                         boolean newValue)

      Fire a value property change for a boolean value.
      Parameters:
        `propertyName` - property name
        `oldValue` - old value
        `newValue` - new value

    - #### fireValueChange

          protected void fireValueChange(java.lang.String propertyName,
                                         int oldValue,
                                         int newValue)

      Fire a value property change for a integer value.
      Parameters:
        `propertyName` - property name
        `oldValue` - old value
        `newValue` - new value

    - #### getPropertyName

          public java.lang.String getPropertyName()

      Get the name of the property. This default implementation returns the basic name.
      Returns:
        property name