public class FixedScopedPreferenceStore
extends org.eclipse.core.commands.common.EventManager
implements org.eclipse.jface.preference.IPersistentPreferenceStore
ScopedPreferenceStore.
It fixes the memory leak described in
these
bugs.
The FixedScopedPreferenceStore is an IPreferenceStore that uses the scopes
provided in org.eclipse.core.runtime.preferences.
A FixedScopedPreferenceStore 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.
ScopedPreferenceStore| Modifier and Type | Field and Description |
|---|---|
protected boolean |
silentRunning
A boolean to indicate the property changes should not be propagated.
|
| Constructor and Description |
|---|
FixedScopedPreferenceStore(org.eclipse.core.runtime.preferences.IScopeContext context,
String qualifier)
Create a new instance of the receiver.
|
FixedScopedPreferenceStore(org.eclipse.core.runtime.preferences.IScopeContext context,
String qualifier,
String defaultQualifierPath)
Create a new instance of the receiver.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) |
boolean |
contains(String name) |
void |
firePropertyChangeEvent(String name,
Object oldValue,
Object newValue) |
boolean |
getBoolean(String name) |
boolean |
getDefaultBoolean(String name) |
double |
getDefaultDouble(String name) |
float |
getDefaultFloat(String name) |
int |
getDefaultInt(String name) |
long |
getDefaultLong(String name) |
String |
getDefaultString(String name) |
double |
getDouble(String name) |
float |
getFloat(String name) |
int |
getInt(String name) |
long |
getLong(String name) |
org.eclipse.core.runtime.preferences.IEclipsePreferences[] |
getPreferenceNodes(boolean includeDefault)
Return the preference path to search preferences on.
|
String |
getString(String name) |
boolean |
isDefault(String name) |
boolean |
needsSaving() |
void |
putValue(String name,
String value) |
void |
removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener) |
void |
save() |
void |
setDefault(String name,
boolean value) |
void |
setDefault(String name,
double value) |
void |
setDefault(String name,
float value) |
void |
setDefault(String name,
int value) |
void |
setDefault(String name,
long value) |
void |
setDefault(String name,
String defaultObject) |
void |
setSearchContexts(org.eclipse.core.runtime.preferences.IScopeContext[] scopes)
Set the search contexts to scopes.
|
void |
setToDefault(String name) |
void |
setValue(String name,
boolean value) |
void |
setValue(String name,
double value) |
void |
setValue(String name,
float value) |
void |
setValue(String name,
int value) |
void |
setValue(String name,
long value) |
void |
setValue(String name,
String value) |
protected boolean silentRunning
public FixedScopedPreferenceStore(org.eclipse.core.runtime.preferences.IScopeContext context,
String qualifier,
String defaultQualifierPath)
context - the scope to store toqualifier - the qualifier used to look up the preference nodedefaultQualifierPath - the qualifier used when looking up the defaultspublic FixedScopedPreferenceStore(org.eclipse.core.runtime.preferences.IScopeContext context,
String qualifier)
context - the scope to store toqualifier - the qualifer used to look up the preference nodepublic void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
addPropertyChangeListener in interface org.eclipse.jface.preference.IPreferenceStorepublic org.eclipse.core.runtime.preferences.IEclipsePreferences[] getPreferenceNodes(boolean includeDefault)
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 otherwisepublic void setSearchContexts(org.eclipse.core.runtime.preferences.IScopeContext[] scopes)
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
nullpublic boolean contains(String name)
contains in interface org.eclipse.jface.preference.IPreferenceStorepublic void firePropertyChangeEvent(String name, Object oldValue, Object newValue)
firePropertyChangeEvent in interface org.eclipse.jface.preference.IPreferenceStorepublic boolean getBoolean(String name)
getBoolean in interface org.eclipse.jface.preference.IPreferenceStorepublic boolean getDefaultBoolean(String name)
getDefaultBoolean in interface org.eclipse.jface.preference.IPreferenceStorepublic double getDefaultDouble(String name)
getDefaultDouble in interface org.eclipse.jface.preference.IPreferenceStorepublic float getDefaultFloat(String name)
getDefaultFloat in interface org.eclipse.jface.preference.IPreferenceStorepublic int getDefaultInt(String name)
getDefaultInt in interface org.eclipse.jface.preference.IPreferenceStorepublic long getDefaultLong(String name)
getDefaultLong in interface org.eclipse.jface.preference.IPreferenceStorepublic String getDefaultString(String name)
getDefaultString in interface org.eclipse.jface.preference.IPreferenceStorepublic double getDouble(String name)
getDouble in interface org.eclipse.jface.preference.IPreferenceStorepublic float getFloat(String name)
getFloat in interface org.eclipse.jface.preference.IPreferenceStorepublic int getInt(String name)
getInt in interface org.eclipse.jface.preference.IPreferenceStorepublic long getLong(String name)
getLong in interface org.eclipse.jface.preference.IPreferenceStorepublic String getString(String name)
getString in interface org.eclipse.jface.preference.IPreferenceStorepublic boolean isDefault(String name)
isDefault in interface org.eclipse.jface.preference.IPreferenceStorepublic boolean needsSaving()
needsSaving in interface org.eclipse.jface.preference.IPreferenceStorepublic void putValue(String name, String value)
putValue in interface org.eclipse.jface.preference.IPreferenceStorepublic void removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
removePropertyChangeListener in interface org.eclipse.jface.preference.IPreferenceStorepublic void setDefault(String name, double value)
setDefault in interface org.eclipse.jface.preference.IPreferenceStorepublic void setDefault(String name, float value)
setDefault in interface org.eclipse.jface.preference.IPreferenceStorepublic void setDefault(String name, int value)
setDefault in interface org.eclipse.jface.preference.IPreferenceStorepublic void setDefault(String name, long value)
setDefault in interface org.eclipse.jface.preference.IPreferenceStorepublic void setDefault(String name, String defaultObject)
setDefault in interface org.eclipse.jface.preference.IPreferenceStorepublic void setDefault(String name, boolean value)
setDefault in interface org.eclipse.jface.preference.IPreferenceStorepublic void setToDefault(String name)
setToDefault in interface org.eclipse.jface.preference.IPreferenceStorepublic void setValue(String name, double value)
setValue in interface org.eclipse.jface.preference.IPreferenceStorepublic void setValue(String name, float value)
setValue in interface org.eclipse.jface.preference.IPreferenceStorepublic void setValue(String name, int value)
setValue in interface org.eclipse.jface.preference.IPreferenceStorepublic void setValue(String name, long value)
setValue in interface org.eclipse.jface.preference.IPreferenceStorepublic void setValue(String name, String value)
setValue in interface org.eclipse.jface.preference.IPreferenceStorepublic void setValue(String name, boolean value)
setValue in interface org.eclipse.jface.preference.IPreferenceStorepublic void save()
throws IOException
save in interface org.eclipse.jface.preference.IPersistentPreferenceStoreIOExceptionCopyright © 2016. All Rights Reserved.