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 ofIPreferenceManagerthat uses plugin to store preferences
- 
- 
Field SummaryFields Modifier and Type Field Description static StringPREFERENCE_KEY_DEFAULT_VALUES_INITIALIZED
 - 
Constructor SummaryConstructors Constructor Description AbstractPreferenceManager()Creates new instance and initializes default values of this manager.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract StringgetPluginID()Returns plugin's ID to write and read preferences from.protected abstract voidinitDefaults()Declares preference with defaults shall not be called manuallyBooleanreadBoolean(String key)Reads boolean preference with given keyBooleanreadBoolean(String key, org.eclipse.core.runtime.preferences.IScopeContext scope)Reads boolean preference with given keyBooleanreadDefaultBoolean(String key)Reads boolean preference with given keyIntegerreadDefaultInteger(String key)Reads default integer preference with given keyStringreadDefaultString(String key)Reads default string preference with given keyIntegerreadInteger(String key)Reads integer preference with given keyIntegerreadInteger(String key, org.eclipse.core.runtime.preferences.IScopeContext scope)Reads integer preference with given keyStringreadString(String key)Reads string preference with given keyStringreadString(String key, org.eclipse.core.runtime.preferences.IScopeContext scope)Reads string preference with given keyvoidsave()Saves all written preferencesprotected voidsetDefaultBooleanPreference(String key, Boolean defaultValue)Sets default value for boolean preference with given keyprotected voidsetDefaultIntegerPreference(String key, Integer defaultValue)Sets default value for integer preference with given keyprotected voidsetDefaultStringPreference(String key, String defaultValue)Sets default value for string preference with given keyvoidwriteBoolean(String preferenceKey, Boolean value)Writes boolean value to the preferences with given keyvoidwriteBoolean(String preferenceKey, Boolean value, org.eclipse.core.runtime.preferences.IScopeContext scope)Writes boolean value to the preferences with given keyvoidwriteInteger(String preferenceKey, Integer value)Writes integer value to the preferences with given keyvoidwriteInteger(String preferenceKey, Integer value, org.eclipse.core.runtime.preferences.IScopeContext scope)Writes integer value to the preferences with given keyvoidwriteString(String preferenceKey, String value)Writes string value to the preferences with given keyvoidwriteString(String preferenceKey, String value, org.eclipse.core.runtime.preferences.IScopeContext scope)Writes string value to the preferences with given key
 
- 
- 
- 
Field Detail- 
PREFERENCE_KEY_DEFAULT_VALUES_INITIALIZEDpublic static final String PREFERENCE_KEY_DEFAULT_VALUES_INITIALIZED - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
writeBooleanpublic void writeBoolean(String preferenceKey, Boolean value) Description copied from interface:IPreferenceManagerWrites boolean value to the preferences with given key- Specified by:
- writeBooleanin interface- IPreferenceManager
- Parameters:
- preferenceKey- The key of the preference, cannot be- null
- value- The value of the preference, cannot be- null
 
 - 
writeStringpublic void writeString(String preferenceKey, String value) Description copied from interface:IPreferenceManagerWrites string value to the preferences with given key- Specified by:
- writeStringin interface- IPreferenceManager
- Parameters:
- preferenceKey- The key of the preference, cannot be- null
- value- The value of the preference, cannot be- null
 
 - 
writeIntegerpublic void writeInteger(String preferenceKey, Integer value) Description copied from interface:IPreferenceManagerWrites integer value to the preferences with given key- Specified by:
- writeIntegerin interface- IPreferenceManager
- value- The value of the preference, cannot be- null
 
 - 
writeBooleanpublic void writeBoolean(String preferenceKey, Boolean value, org.eclipse.core.runtime.preferences.IScopeContext scope) Description copied from interface:IPreferenceManagerWrites boolean value to the preferences with given key- Specified by:
- writeBooleanin interface- IPreferenceManager
- Parameters:
- preferenceKey- The key of the preference, cannot be- null
- value- The value of the preference, cannot be- null
 
 - 
writeStringpublic void writeString(String preferenceKey, String value, org.eclipse.core.runtime.preferences.IScopeContext scope) Description copied from interface:IPreferenceManagerWrites string value to the preferences with given key- Specified by:
- writeStringin interface- IPreferenceManager
- Parameters:
- preferenceKey- The key of the preference, cannot be- null
- value- The value of the preference, cannot be- null
 
 - 
writeIntegerpublic void writeInteger(String preferenceKey, Integer value, org.eclipse.core.runtime.preferences.IScopeContext scope) Description copied from interface:IPreferenceManagerWrites integer value to the preferences with given key- Specified by:
- writeIntegerin interface- IPreferenceManager
- value- The value of the preference, cannot be- null
 
 - 
readBooleanpublic Boolean readBoolean(String key) Description copied from interface:IPreferenceManagerReads boolean preference with given key- Specified by:
- readBooleanin interface- IPreferenceManager
- Parameters:
- key- The key of the preference, cannot be- null
- Returns:
- The boolean value associated to the given key, can be nullif there is no preference with given key
 
 - 
readBooleanpublic Boolean readBoolean(String key, org.eclipse.core.runtime.preferences.IScopeContext scope) Description copied from interface:IPreferenceManagerReads boolean preference with given key- Specified by:
- readBooleanin interface- IPreferenceManager
- Parameters:
- key- The key of the preference, cannot be- null
- Returns:
- The boolean value associated to the given key, can be nullif there is no preference with given key
 
 - 
readStringpublic String readString(String key) Description copied from interface:IPreferenceManagerReads string preference with given key- Specified by:
- readStringin interface- IPreferenceManager
- Parameters:
- key- The key of the preference, cannot be- null
- Returns:
- The string value associated to the given key, can be nullif there is no preference with given key
 
 - 
readStringpublic String readString(String key, org.eclipse.core.runtime.preferences.IScopeContext scope) Description copied from interface:IPreferenceManagerReads string preference with given key- Specified by:
- readStringin interface- IPreferenceManager
- Parameters:
- key- The key of the preference, cannot be- null
- Returns:
- The string value associated to the given key, can be nullif there is no preference with given key
 
 - 
readIntegerpublic Integer readInteger(String key) Description copied from interface:IPreferenceManagerReads integer preference with given key- Specified by:
- readIntegerin interface- IPreferenceManager
- Parameters:
- key- The key of the preference, cannot be- null
- Returns:
- The integer value associated to the given key, can be nullif there is no preference with given key
 
 - 
readIntegerpublic Integer readInteger(String key, org.eclipse.core.runtime.preferences.IScopeContext scope) Description copied from interface:IPreferenceManagerReads integer preference with given key- Specified by:
- readIntegerin interface- IPreferenceManager
- Parameters:
- key- The key of the preference, cannot be- null
- Returns:
- The integer value associated to the given key, can be nullif there is no preference with given key
 
 - 
readDefaultBooleanpublic Boolean readDefaultBoolean(String key) Description copied from interface:IPreferenceManagerReads boolean preference with given key- Specified by:
- readDefaultBooleanin interface- IPreferenceManager
- Parameters:
- key- The key of the preference, cannot be- null
- Returns:
- The default boolean value associated to the given key, can be nullif there is no preference with given key
 
 - 
readDefaultStringpublic String readDefaultString(String key) Description copied from interface:IPreferenceManagerReads default string preference with given key- Specified by:
- readDefaultStringin interface- IPreferenceManager
- Parameters:
- key- The key of the preference, cannot be- null
- Returns:
- The default string value associated to the given key, can be nullif there is no preference with given key
 
 - 
readDefaultIntegerpublic Integer readDefaultInteger(String key) Description copied from interface:IPreferenceManagerReads default integer preference with given key- Specified by:
- readDefaultIntegerin interface- IPreferenceManager
- Parameters:
- key- The key of the preference, cannot be- null
- Returns:
- The default integer value associated to the given key, can be nullif there is no preference with given key
 
 - 
savepublic void save() Description copied from interface:IPreferenceManagerSaves all written preferences- Specified by:
- savein interface- IPreferenceManager
 
 - 
getPluginIDprotected abstract String getPluginID() Returns plugin's ID to write and read preferences from.- Returns:
- Plugin id that extends this class, cannot be null
 
 - 
initDefaultsprotected abstract void initDefaults() Declares preference with defaults shall not be called manually- See Also:
- #setDefaultBooleanPreference(String, String),- setDefaultIntegerPreference(String, Integer),- setDefaultStringPreference(String, String)
 
 - 
setDefaultBooleanPreferenceprotected 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
 
 - 
setDefaultIntegerPreferenceprotected 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
 
 
- 
 
-