Interface IPreferenceStore

All Known Implementing Classes:
ButtonOrderPreferences, ClientPreferences, GUIPreferences, PreferenceStore, PreferenceStoreProxy, UnitDisplayOrderPreferences

public interface IPreferenceStore
The IPreferenceStore interface represents a mapping of named preferences to values. In case of absence of the value for a given name the default value is returned. If there is no default value for that preference, then predefined default value for the preference type is returned. Predefined default values for the primitive types follows:
  • boolean = false
  • int = 0
  • long = 0
  • String = "" (the empty string)
  • float = 0.0f
  • double = 0.0
A preference change event is reported whenever a preferences current value changes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
    The predefined default value for boolean preference
    static final double
    The predefined default value for double preference
    static final String
    The string representation used for false
    static final float
    The predefined default value for float preference
    static final int
    The predefined default value for int preference
    static final long
    The predefined default value for long preference
    static final String
    The predefined default value for String preference
    static final String
    The string representation used for true
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a preference change listener to this store.
     
    boolean
    Returns the value of the boolean preference with the given name.
    boolean
    Returns the default value for the boolean preference with the given name.
    double
    Returns the default value for the double preference with the given name.
    float
    Returns the default value for the float preference with the given name.
    int
    Returns the default value for the int preference with the given name.
    long
    Returns the default value for the long preference with the given name.
    Returns the default value for the String preference with the given name.
    double
    Returns the value of the double preference with the given name.
    float
    Returns the value of the float preference with the given name.
    int
    getInt(String name)
    Returns the value of the int preference with the given name.
    long
    Returns the value of the long preference with the given name.
    Returns the value of the String preference with the given name.
    boolean
     
    void
    putValue(String name, String value)
    Just sets the current value of the preference with the given name.
    void
    Removes the given listener from this store.
    void
    setDefault(String name, boolean value)
    Sets the default value for the boolean preference with the given name.
    void
    setDefault(String name, double value)
    Sets the default value for the double preference with the given name.
    void
    setDefault(String name, float value)
    Sets the default value for the float preference with the given name.
    void
    setDefault(String name, int value)
    Sets the default value for the int preference with the given name.
    void
    setDefault(String name, long value)
    Sets the default value for the long preference with the given name.
    void
    setDefault(String name, String value)
    Sets the default value for the string preference with the given name.
    void
    setValue(String name, boolean value)
    Sets the current value of the boolean preference with the given name.
    void
    setValue(String name, double value)
    Sets the current value of the double preference with the given name.
    void
    setValue(String name, float value)
    Sets the current value of the float preference with the given name.
    void
    setValue(String name, int value)
    Sets the current value of the int preference with the given name.
    void
    setValue(String name, long value)
    Sets the current value of the long preference with the given name.
    void
    setValue(String name, String value)
    Sets the current value of the String preference with the given name.
  • Field Details

    • BOOLEAN_DEFAULT

      static final boolean BOOLEAN_DEFAULT
      The predefined default value for boolean preference
      See Also:
    • INT_DEFAULT

      static final int INT_DEFAULT
      The predefined default value for int preference
      See Also:
    • LONG_DEFAULT

      static final long LONG_DEFAULT
      The predefined default value for long preference
      See Also:
    • STRING_DEFAULT

      static final String STRING_DEFAULT
      The predefined default value for String preference
      See Also:
    • FLOAT_DEFAULT

      static final float FLOAT_DEFAULT
      The predefined default value for float preference
      See Also:
    • DOUBLE_DEFAULT

      static final double DOUBLE_DEFAULT
      The predefined default value for double preference
      See Also:
    • TRUE

      static final String TRUE
      The string representation used for true
      See Also:
    • FALSE

      static final String FALSE
      The string representation used for false
      See Also:
  • Method Details

    • getDefaultBoolean

      boolean getDefaultBoolean(String name)
      Returns the default value for the boolean preference with the given name.
    • getDefaultInt

      int getDefaultInt(String name)
      Returns the default value for the int preference with the given name.
    • getDefaultLong

      long getDefaultLong(String name)
      Returns the default value for the long preference with the given name.
    • getDefaultString

      String getDefaultString(String name)
      Returns the default value for the String preference with the given name.
    • getDefaultDouble

      double getDefaultDouble(String name)
      Returns the default value for the double preference with the given name.
    • getDefaultFloat

      float getDefaultFloat(String name)
      Returns the default value for the float preference with the given name.
    • setDefault

      void setDefault(String name, boolean value)
      Sets the default value for the boolean preference with the given name.
    • setDefault

      void setDefault(String name, int value)
      Sets the default value for the int preference with the given name.
    • setDefault

      void setDefault(String name, long value)
      Sets the default value for the long preference with the given name.
    • setDefault

      void setDefault(String name, String value)
      Sets the default value for the string preference with the given name.
    • setDefault

      void setDefault(String name, float value)
      Sets the default value for the float preference with the given name.
    • setDefault

      void setDefault(String name, double value)
      Sets the default value for the double preference with the given name.
    • getBoolean

      boolean getBoolean(String name)
      Returns the value of the boolean preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a boolean.
    • getInt

      int getInt(String name)
      Returns the value of the int preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as an int.
    • getLong

      long getLong(String name)
      Returns the value of the long preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a long.
    • getString

      String getString(String name)
      Returns the value of the String preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a String.
    • getFloat

      float getFloat(String name)
      Returns the value of the float preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a float.
    • getDouble

      double getDouble(String name)
      Returns the value of the double preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a double.
    • setValue

      void setValue(String name, boolean value)
      Sets the current value of the boolean preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.
    • setValue

      void setValue(String name, int value)
      Sets the current value of the int preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.
    • setValue

      void setValue(String name, long value)
      Sets the current value of the long preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.
    • setValue

      void setValue(String name, String value)
      Sets the current value of the String preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.
    • setValue

      void setValue(String name, float value)
      Sets the current value of the float preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.
    • setValue

      void setValue(String name, double value)
      Sets the current value of the double preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.
    • addPreferenceChangeListener

      void addPreferenceChangeListener(IPreferenceChangeListener listener)
      Adds a preference change listener to this store.
      Parameters:
      listener - a preference change listener
    • removePreferenceChangeListener

      void removePreferenceChangeListener(IPreferenceChangeListener listener)
      Removes the given listener from this store.
    • putValue

      void putValue(String name, String value)
      Just sets the current value of the preference with the given name. does not fire preference change event
    • getAdvancedProperties

      String[] getAdvancedProperties()
    • hasProperty

      boolean hasProperty(String name)