Class AbstractPreferenceManager

java.lang.Object
com.e1c.g5.v8.dt.formatter.preferences.manager.AbstractPreferenceManager
All Implemented Interfaces:
IPreferenceManager
Direct Known Subclasses:
BslPreferenceManager

public abstract class AbstractPreferenceManager extends Object implements IPreferenceManager
This class is implementation of IPreferenceManager that uses plugin to store preferences
  • Field Details

    • PREFERENCE_KEY_DEFAULT_VALUES_INITIALIZED

      public static final String PREFERENCE_KEY_DEFAULT_VALUES_INITIALIZED
      See Also:
  • Constructor Details

    • AbstractPreferenceManager

      public AbstractPreferenceManager()
      Creates new instance and initializes default values of this manager.
  • Method Details

    • writeBoolean

      public void writeBoolean(String preferenceKey, Boolean value)
      Description copied from interface: IPreferenceManager
      Writes boolean value to the preferences with given key
      Specified by:
      writeBoolean in interface IPreferenceManager
      Parameters:
      preferenceKey - The key of the preference, cannot be null
      value - The value of the preference, cannot be null
    • writeString

      public void writeString(String preferenceKey, String value)
      Description copied from interface: IPreferenceManager
      Writes string value to the preferences with given key
      Specified by:
      writeString in interface IPreferenceManager
      Parameters:
      preferenceKey - The key of the preference, cannot be null
      value - The value of the preference, cannot be null
    • writeInteger

      public void writeInteger(String preferenceKey, Integer value)
      Description copied from interface: IPreferenceManager
      Writes integer value to the preferences with given key
      Specified by:
      writeInteger in interface IPreferenceManager
      value - The value of the preference, cannot be null
    • writeBoolean

      public void writeBoolean(String preferenceKey, Boolean value, org.eclipse.core.runtime.preferences.IScopeContext scope)
      Description copied from interface: IPreferenceManager
      Writes boolean value to the preferences with given key
      Specified by:
      writeBoolean in interface IPreferenceManager
      Parameters:
      preferenceKey - The key of the preference, cannot be null
      value - The value of the preference, cannot be null
    • writeString

      public void writeString(String preferenceKey, String value, org.eclipse.core.runtime.preferences.IScopeContext scope)
      Description copied from interface: IPreferenceManager
      Writes string value to the preferences with given key
      Specified by:
      writeString in interface IPreferenceManager
      Parameters:
      preferenceKey - The key of the preference, cannot be null
      value - The value of the preference, cannot be null
    • writeInteger

      public void writeInteger(String preferenceKey, Integer value, org.eclipse.core.runtime.preferences.IScopeContext scope)
      Description copied from interface: IPreferenceManager
      Writes integer value to the preferences with given key
      Specified by:
      writeInteger in interface IPreferenceManager
      value - The value of the preference, cannot be null
    • readBoolean

      public Boolean readBoolean(String key)
      Description copied from interface: IPreferenceManager
      Reads boolean preference with given key
      Specified by:
      readBoolean in interface IPreferenceManager
      Parameters:
      key - The key of the preference, cannot be null
      Returns:
      The boolean value associated to the given key, can be null if there is no preference with given key
    • readBoolean

      public Boolean readBoolean(String key, org.eclipse.core.runtime.preferences.IScopeContext scope)
      Description copied from interface: IPreferenceManager
      Reads boolean preference with given key
      Specified by:
      readBoolean in interface IPreferenceManager
      Parameters:
      key - The key of the preference, cannot be null
      Returns:
      The boolean value associated to the given key, can be null if there is no preference with given key
    • readString

      public String readString(String key)
      Description copied from interface: IPreferenceManager
      Reads string preference with given key
      Specified by:
      readString in interface IPreferenceManager
      Parameters:
      key - The key of the preference, cannot be null
      Returns:
      The string value associated to the given key, can be null if there is no preference with given key
    • readString

      public String readString(String key, org.eclipse.core.runtime.preferences.IScopeContext scope)
      Description copied from interface: IPreferenceManager
      Reads string preference with given key
      Specified by:
      readString in interface IPreferenceManager
      Parameters:
      key - The key of the preference, cannot be null
      Returns:
      The string value associated to the given key, can be null if there is no preference with given key
    • readInteger

      public Integer readInteger(String key)
      Description copied from interface: IPreferenceManager
      Reads integer preference with given key
      Specified by:
      readInteger in interface IPreferenceManager
      Parameters:
      key - The key of the preference, cannot be null
      Returns:
      The integer value associated to the given key, can be null if there is no preference with given key
    • readInteger

      public Integer readInteger(String key, org.eclipse.core.runtime.preferences.IScopeContext scope)
      Description copied from interface: IPreferenceManager
      Reads integer preference with given key
      Specified by:
      readInteger in interface IPreferenceManager
      Parameters:
      key - The key of the preference, cannot be null
      Returns:
      The integer value associated to the given key, can be null if there is no preference with given key
    • readDefaultBoolean

      public Boolean readDefaultBoolean(String key)
      Description copied from interface: IPreferenceManager
      Reads boolean preference with given key
      Specified by:
      readDefaultBoolean in interface IPreferenceManager
      Parameters:
      key - The key of the preference, cannot be null
      Returns:
      The default boolean value associated to the given key, can be null if there is no preference with given key
    • readDefaultString

      public String readDefaultString(String key)
      Description copied from interface: IPreferenceManager
      Reads default string preference with given key
      Specified by:
      readDefaultString in interface IPreferenceManager
      Parameters:
      key - The key of the preference, cannot be null
      Returns:
      The default string value associated to the given key, can be null if there is no preference with given key
    • readDefaultInteger

      public Integer readDefaultInteger(String key)
      Description copied from interface: IPreferenceManager
      Reads default integer preference with given key
      Specified by:
      readDefaultInteger in interface IPreferenceManager
      Parameters:
      key - The key of the preference, cannot be null
      Returns:
      The default integer value associated to the given key, can be null if there is no preference with given key
    • save

      public void save()
      Description copied from interface: IPreferenceManager
      Saves all written preferences
      Specified by:
      save in interface IPreferenceManager
    • getPluginID

      protected abstract String getPluginID()
      Returns plugin's ID to write and read preferences from.
      Returns:
      Plugin id that extends this class, cannot be null
    • initDefaults

      protected abstract void initDefaults()
      Declares preference with defaults shall not be called manually
      See Also:
    • setDefaultBooleanPreference

      protected void setDefaultBooleanPreference(String key, Boolean defaultValue)
      Sets default value for boolean preference with given key
      Parameters:
      key - The key of the preference, cannot be null
      defaultValue - The value of the preference, cannot be null
    • setDefaultIntegerPreference

      protected void setDefaultIntegerPreference(String key, Integer defaultValue)
      Sets default value for integer preference with given key
      Parameters:
      key - The key of the preference, cannot be null
      defaultValue - The value of the preference, cannot be null
    • setDefaultStringPreference

      protected void setDefaultStringPreference(String key, String defaultValue)
      Sets default value for string preference with given key
      Parameters:
      key - The key of the preference, cannot be null
      defaultValue - The value of the preference, cannot be null