Package org.eclipse.handly.ui.preference

## Class BooleanPreference

- java.lang.Object
- - org.eclipse.handly.ui.preference.AbstractPreference
  - - org.eclipse.handly.ui.preference.BooleanPreference

- All Implemented Interfaces:
    `IBooleanPreference`, `IPreference`
  Direct Known Subclasses:
    `LexicalSortPreference`, `LinkWithEditorPreference`

      public class BooleanPreference
      extends AbstractPreference
      implements IBooleanPreference

  Implements a boolean-valued preference. The preference is stored in an `IPreferenceStore`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BooleanPreference​(java.lang.String name, org.eclipse.jface.preference.IPreferenceStore store)` | Creates a new boolean-valued preference with the given name and the given store.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `getValue()` | Returns the current value of this preference.
    `void` | `setDefault​(boolean value)` | Sets the default value for this preference.
    `void` | `setValue​(boolean value)` | Sets the current value of this preference.

    - ### Methods inherited from class org.eclipse.handly.ui.preference.AbstractPreference

      `addListener, getName, getStore, isDefault, removeListener, setToDefault`

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

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

    - ### Methods inherited from interface org.eclipse.handly.ui.preference.IPreference

      `addListener, removeListener`

- - ### Constructor Detail

    - #### BooleanPreference

          public BooleanPreference​(java.lang.String name,
                                   org.eclipse.jface.preference.IPreferenceStore store)

      Creates a new boolean-valued preference with the given name and the given store.
      Parameters:
        `name` - the preference name (not `null`)
        `store` - the preference store (not `null`)

  - ### Method Detail

    - #### getValue

          public final boolean getValue()

      Description copied from interface: `IBooleanPreference`
      Returns the current value of this preference.
      Specified by:
        `getValue` in interface `IBooleanPreference`
      Returns:
        the current value of this preference

    - #### setValue

          public final void setValue​(boolean value)

      Description copied from interface: `IBooleanPreference`
      Sets the current value of this preference.

      A preference change event is reported if the current value of the preference actually changes from its previous value.

      Specified by:
        `setValue` in interface `IBooleanPreference`
      Parameters:
        `value` - the new current value of this preference

    - #### setDefault

          public final void setDefault​(boolean value)

      Sets the default value for this preference.

      Note that if the preference's current value equals the old default value, the current value changes to the new default value. No preference change events are reported by changing default values.

      Parameters:
        `value` - the new default value for this preference