Class AbstractPreferenceManager
java.lang.Object
com.e1c.g5.v8.dt.formatter.preferences.manager.AbstractPreferenceManager
- All Implemented Interfaces:
IPreferenceManager
- Direct Known Subclasses:
BslPreferenceManager
This class is implementation of
IPreferenceManager
that uses plugin to store preferences-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates new instance and initializes default values of this manager. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
Returns plugin's ID to write and read preferences from.protected abstract void
Declares preference with defaults shall not be called manuallyreadBoolean
(String key) Reads boolean preference with given keyreadBoolean
(String key, org.eclipse.core.runtime.preferences.IScopeContext scope) Reads boolean preference with given keyreadDefaultBoolean
(String key) Reads boolean preference with given keyreadDefaultInteger
(String key) Reads default integer preference with given keyreadDefaultString
(String key) Reads default string preference with given keyreadInteger
(String key) Reads integer preference with given keyreadInteger
(String key, org.eclipse.core.runtime.preferences.IScopeContext scope) Reads integer preference with given keyreadString
(String key) Reads string preference with given keyreadString
(String key, org.eclipse.core.runtime.preferences.IScopeContext scope) Reads string preference with given keyvoid
save()
Saves all written preferencesprotected void
setDefaultBooleanPreference
(String key, Boolean defaultValue) Sets default value for boolean preference with given keyprotected void
setDefaultIntegerPreference
(String key, Integer defaultValue) Sets default value for integer preference with given keyprotected void
setDefaultStringPreference
(String key, String defaultValue) Sets default value for string preference with given keyvoid
writeBoolean
(String preferenceKey, Boolean value) Writes boolean value to the preferences with given keyvoid
writeBoolean
(String preferenceKey, Boolean value, org.eclipse.core.runtime.preferences.IScopeContext scope) Writes boolean value to the preferences with given keyvoid
writeInteger
(String preferenceKey, Integer value) Writes integer value to the preferences with given keyvoid
writeInteger
(String preferenceKey, Integer value, org.eclipse.core.runtime.preferences.IScopeContext scope) Writes integer value to the preferences with given keyvoid
writeString
(String preferenceKey, String value) Writes string value to the preferences with given keyvoid
writeString
(String preferenceKey, String value, org.eclipse.core.runtime.preferences.IScopeContext scope) Writes string value to the preferences with given key
-
Field Details
-
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
Description copied from interface:IPreferenceManager
Writes boolean value to the preferences with given key- Specified by:
writeBoolean
in interfaceIPreferenceManager
- Parameters:
preferenceKey
- The key of the preference, cannot benull
value
- The value of the preference, cannot benull
-
writeString
Description copied from interface:IPreferenceManager
Writes string value to the preferences with given key- Specified by:
writeString
in interfaceIPreferenceManager
- Parameters:
preferenceKey
- The key of the preference, cannot benull
value
- The value of the preference, cannot benull
-
writeInteger
Description copied from interface:IPreferenceManager
Writes integer value to the preferences with given key- Specified by:
writeInteger
in interfaceIPreferenceManager
value
- The value of the preference, cannot benull
-
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 interfaceIPreferenceManager
- Parameters:
preferenceKey
- The key of the preference, cannot benull
value
- The value of the preference, cannot benull
-
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 interfaceIPreferenceManager
- Parameters:
preferenceKey
- The key of the preference, cannot benull
value
- The value of the preference, cannot benull
-
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 interfaceIPreferenceManager
value
- The value of the preference, cannot benull
-
readBoolean
Description copied from interface:IPreferenceManager
Reads boolean preference with given key- Specified by:
readBoolean
in interfaceIPreferenceManager
- Parameters:
key
- The key of the preference, cannot benull
- Returns:
- The boolean value associated to the given key, can be
null
if there is no preference with given key
-
readBoolean
Description copied from interface:IPreferenceManager
Reads boolean preference with given key- Specified by:
readBoolean
in interfaceIPreferenceManager
- Parameters:
key
- The key of the preference, cannot benull
- Returns:
- The boolean value associated to the given key, can be
null
if there is no preference with given key
-
readString
Description copied from interface:IPreferenceManager
Reads string preference with given key- Specified by:
readString
in interfaceIPreferenceManager
- Parameters:
key
- The key of the preference, cannot benull
- Returns:
- The string value associated to the given key, can be
null
if there is no preference with given key
-
readString
Description copied from interface:IPreferenceManager
Reads string preference with given key- Specified by:
readString
in interfaceIPreferenceManager
- Parameters:
key
- The key of the preference, cannot benull
- Returns:
- The string value associated to the given key, can be
null
if there is no preference with given key
-
readInteger
Description copied from interface:IPreferenceManager
Reads integer preference with given key- Specified by:
readInteger
in interfaceIPreferenceManager
- Parameters:
key
- The key of the preference, cannot benull
- Returns:
- The integer value associated to the given key, can be
null
if there is no preference with given key
-
readInteger
Description copied from interface:IPreferenceManager
Reads integer preference with given key- Specified by:
readInteger
in interfaceIPreferenceManager
- Parameters:
key
- The key of the preference, cannot benull
- Returns:
- The integer value associated to the given key, can be
null
if there is no preference with given key
-
readDefaultBoolean
Description copied from interface:IPreferenceManager
Reads boolean preference with given key- Specified by:
readDefaultBoolean
in interfaceIPreferenceManager
- Parameters:
key
- The key of the preference, cannot benull
- Returns:
- The default boolean value associated to the given key, can be
null
if there is no preference with given key
-
readDefaultString
Description copied from interface:IPreferenceManager
Reads default string preference with given key- Specified by:
readDefaultString
in interfaceIPreferenceManager
- Parameters:
key
- The key of the preference, cannot benull
- Returns:
- The default string value associated to the given key, can be
null
if there is no preference with given key
-
readDefaultInteger
Description copied from interface:IPreferenceManager
Reads default integer preference with given key- Specified by:
readDefaultInteger
in interfaceIPreferenceManager
- Parameters:
key
- The key of the preference, cannot benull
- 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 interfaceIPreferenceManager
-
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(String, String)
setDefaultIntegerPreference(String, Integer)
setDefaultStringPreference(String, String)
-
setDefaultBooleanPreference
Sets default value for boolean preference with given key- Parameters:
key
- The key of the preference, cannot benull
defaultValue
- The value of the preference, cannot benull
-
setDefaultIntegerPreference
Sets default value for integer preference with given key- Parameters:
key
- The key of the preference, cannot benull
defaultValue
- The value of the preference, cannot benull
-
setDefaultStringPreference
Sets default value for string preference with given key- Parameters:
key
- The key of the preference, cannot benull
defaultValue
- The value of the preference, cannot benull
-