public class ScopedPreferenceStore extends EventManager implements IPersistentPreferenceStore, IPreferenceStore
The ScopedPreferenceStore is an IPreferenceStore that uses the scopes provided in org.eclipse.core.runtime.preferences.
A ScopedPreferenceStore does the lookup of a preference based on it's search scopes and sets the value of the preference based on its store scope.
The default scope is always included in the search scopes when searching for preference values.
Modifiers | Name | Description |
---|---|---|
static String |
INL_DO_NOT_ADD_DEFAULT_TO_SEARCH_CONTEXTS |
|
protected boolean |
silentRunning |
A boolean to indicate the property changes should not be propagated. |
Constructor and description |
---|
ScopedPreferenceStore
(IScopeContext context, String qualifier, String defaultQualifierPath) Create a new instance of the receiver. |
ScopedPreferenceStore
(IScopeContext context, String qualifier) Create a new instance of the receiver. |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addPropertyChangeListener(IPropertyChangeListener listener) |
|
public void |
added(NodeChangeEvent event) |
|
public boolean |
contains(String name) |
|
public void |
firePropertyChangeEvent(String name, Object oldValue, Object newValue) |
|
public boolean |
getBoolean(String name) |
|
public boolean |
getDefaultBoolean(String name) |
|
public double |
getDefaultDouble(String name) |
|
public float |
getDefaultFloat(String name) |
|
public int |
getDefaultInt(String name) |
|
public long |
getDefaultLong(String name) |
|
public String |
getDefaultString(String name) |
|
public double |
getDouble(String name) |
|
public float |
getFloat(String name) |
|
public int |
getInt(String name) |
|
public long |
getLong(String name) |
|
public IEclipsePreferences[] |
getPreferenceNodes(boolean includeDefault) Return the preference path to search preferences on. |
|
public String |
getQualifier() |
|
public String |
getString(String name) |
|
public boolean |
isDefault(String name) |
|
public boolean |
needsSaving() |
|
public void |
preferenceChange(PreferenceChangeEvent event) |
|
public void |
putValue(String name, String value) |
|
public void |
removePropertyChangeListener(IPropertyChangeListener listener) |
|
public void |
removed(NodeChangeEvent event) |
|
public void |
run() |
|
public void |
save() |
|
public void |
setDefault(String name, double value) |
|
public void |
setDefault(String name, float value) |
|
public void |
setDefault(String name, int value) |
|
public void |
setDefault(String name, long value) |
|
public void |
setDefault(String name, String defaultObject) |
|
public void |
setDefault(String name, boolean value) |
|
public void |
setSearchContexts(IScopeContext[] scopes) Set the search contexts to scopes. |
|
public void |
setToDefault(String name) |
|
public void |
setValue(String name, double value) |
|
public void |
setValue(String name, float value) |
|
public void |
setValue(String name, int value) |
|
public void |
setValue(String name, long value) |
|
public void |
setValue(String name, String value) |
|
public void |
setValue(String name, boolean value) |
A boolean to indicate the property changes should not be propagated.
Create a new instance of the receiver. Store the values in context in the node looked up by qualifier. NOTE: Any instance of ScopedPreferenceStore should call
context
- the scope to store toqualifier
- the qualifier used to look up the preference nodedefaultQualifierPath
- the qualifier used when looking up the defaultsCreate a new instance of the receiver. Store the values in context in the node looked up by qualifier.
context
- the scope to store toqualifier
- the qualifer used to look up the preference nodeReturn the preference path to search preferences on. This is the list of preference nodes based on the scope contexts for this store. If there are no search contexts set, then return this store's context.
Whether or not the default context should be included in the resulting list
is specified by the includeDefault
parameter.
includeDefault
- true
if the default context should be
included and false
otherwiseSet the search contexts to scopes. When searching for a value the seach will be done in the order of scope contexts and will not search the storeContext unless it is in this list.
If the given list is null
, then clear this store's search
contexts. This means that only this store's scope context and default scope
will be used during preference value searching.
The defaultContext will be added to the end of this list automatically and MUST NOT be included by the user.
scopes
- a list of scope contexts to use when searching, or
null