de.caff.util.settings

## Class SimplePreferenceGroup

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

- All Implemented Interfaces:
    ChangeableItem, PreferenceProperty

      public class SimplePreferenceGroup
      extends java.lang.Object
      implements PreferenceProperty

  A simple grouping of preferences properties. It will forward everything to the collected preference properties.
  Since:
    November 27, 2016
  Author:
    Rammi

- - ### Field Summary

    - ### Fields inherited from interface de.caff.util.settings.PreferenceProperty

      `PROPERTY_VALUE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimplePreferenceGroup(java.util.List<PreferenceProperty> properties)` Constructor.
    `SimplePreferenceGroup(PreferenceProperty... properties)` 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.
    `void` | `readFrom(java.util.prefs.Preferences preferences)` Read the property value from the preferences.
    `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.
    `void` | `storeTo(java.util.prefs.Preferences preferences)` Store the current property value in the preferences.

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

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

- - ### Constructor Detail

    - #### SimplePreferenceGroup

          public SimplePreferenceGroup(@NotNull
                                       java.util.List<PreferenceProperty> properties)

      Constructor.
      Parameters:
        `properties` - preference properties in this group

    - #### SimplePreferenceGroup

          public SimplePreferenceGroup(PreferenceProperty... properties)

      Constructor.
      Parameters:
        `properties` - prefe

  - ### Method Detail

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

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

    - #### readFrom

          public void readFrom(@NotNull
                               java.util.prefs.Preferences preferences)

      Read the property value from the preferences.
      Specified by:
        `readFrom` in interface `PreferenceProperty`
      Parameters:
        `preferences` - preferences from where to read the property value

    - #### storeTo

          public void storeTo(@NotNull
                              java.util.prefs.Preferences preferences)

      Store the current property value in the preferences.
      Specified by:
        `storeTo` in interface `PreferenceProperty`
      Parameters:
        `preferences` - preferences where to store the property value

    - #### 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(PropertyChangeListener)` method.

      Specified by:
        `addValueChangeListenerWeakly` in interface `ChangeableItem`
      Parameters:
        `listener` - value change listener to add
      See Also:
        `addValueChangeListener(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(PropertyChangeListener)`