Crazy behaviour in ScopedPreferenceStore.setValue(string, string) method [message #308132] |
Wed, 13 September 2006 22:50  |
Eclipse User |
|
|
|
Originally posted by: bnegrao.gmail.com
Hi guys, when I'm using the Preferences in Eclipse i found an odd
behaviour.
If I try to set a preference in the ConfigurationScope() to a value that
is the default value set in the DefaultScope() of that preference, the
method setValue(String, String) of the ScopedPreferenceStore class will
silently remove the preference key from the ConfigurationScope() store!
What obligates me to retrieve the value from the DefaultScope() preference.
Does someone out there understand why this is being accomplished this way?
Bellow is the source of the mentioned method:
/*
* (non-Javadoc)
*
* @see
org.eclipse.jface.preference.IPreferenceStore#setValue(java. lang.String,
* java.lang.String)
*/
public void setValue(String name, String value) {
// Do not turn on silent running here as Strings are propagated
if (getDefaultString(name).equals(value)) {
getStorePreferences().remove(name); <==HERE! REMOVING MY PREF!
} else {
getStorePreferences().put(name, value);
}
dirty = true;
}
Thank you,
bruno.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05263 seconds