public final class Preferences
extends java.lang.Object
IEclipsePreferences story. Adapted from
org.eclipse.debug.internal.core.Preferences.| Modifier and Type | Method and Description |
|---|---|
static void |
addPreferenceChangeListener(java.lang.String qualifier,
org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
Adds the given preference listener to the
DefaultScope and the InstanceScope |
static boolean |
contains(java.lang.String qualifier,
java.lang.String name)
Returns whether the named preference is know in the preference store.
|
static boolean |
getBoolean(java.lang.String qualifier,
java.lang.String key)
Returns the value in the preference store for the given key.
|
static byte[] |
getByteArray(java.lang.String qualifier,
java.lang.String key)
Returns the value in the preference store for the given key.
|
static boolean |
getDefaultBoolean(java.lang.String qualifier,
java.lang.String key,
boolean defaultvalue)
Returns the default boolean value stored in the
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScope |
static byte[] |
getDefaultByteArray(java.lang.String qualifier,
java.lang.String key,
byte[] defaultvalue)
Returns the default byte array value stored in the
DefaultScope for the given key or the specified default value if
the key does not
appear in the DefaultScope |
static double |
getDefaultDouble(java.lang.String qualifier,
java.lang.String key,
double defaultvalue)
Returns the default double value stored in the
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScope |
static float |
getDefaultFloat(java.lang.String qualifier,
java.lang.String key,
float defaultvalue)
Returns the default float value stored in the
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScope |
static int |
getDefaultInt(java.lang.String qualifier,
java.lang.String key,
int defaultvalue)
Returns the default integer value stored in the
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScope |
static long |
getDefaultLong(java.lang.String qualifier,
java.lang.String key,
long defaultvalue)
Returns the default long value stored in the
DefaultScope for the
given key or the specified default value if the key does not appear in
the DefaultScope |
static java.lang.String |
getDefaultString(java.lang.String qualifier,
java.lang.String key,
java.lang.String defaultvalue)
Returns the default string value stored in the
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScope |
static double |
getDouble(java.lang.String qualifier,
java.lang.String key)
Returns the value in the preference store for the given key.
|
static float |
getFloat(java.lang.String qualifier,
java.lang.String key)
Returns the value in the preference store for the given key.
|
static int |
getInt(java.lang.String qualifier,
java.lang.String key)
Returns the value in the preference store for the given key.
|
static long |
getLong(java.lang.String qualifier,
java.lang.String key)
Returns the value in the preference store for the given key.
|
static java.lang.String |
getString(java.lang.String qualifier,
java.lang.String key)
Returns the value in the preference store for the given key.
|
static boolean |
isDefault(java.lang.String qualifier,
java.lang.String name)
Returns true if the named preference has the default value.
|
static void |
removePreferenceChangeListener(java.lang.String qualifier,
org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
Removes the given preference listener from the
DefaultScope and
the InstanceScope |
static void |
savePreferences(java.lang.String qualifier)
Save the preferences for the given plugin identifier.
|
static void |
setBoolean(java.lang.String qualifier,
java.lang.String key,
boolean value)
Sets a boolean preference in the
InstanceScope. |
static void |
setByteArray(java.lang.String qualifier,
java.lang.String key,
byte[] value)
Sets a byte array preference in the
InstanceScope. |
static void |
setDefaultBoolean(java.lang.String qualifier,
java.lang.String key,
boolean value)
Sets a boolean in the
DefaultScope |
static void |
setDefaultByteArray(java.lang.String qualifier,
java.lang.String key,
byte[] value)
Sets a byte array in the
DefaultScope |
static void |
setDefaultDouble(java.lang.String qualifier,
java.lang.String key,
double value)
Sets a double in the
DefaultScope |
static void |
setDefaultFloat(java.lang.String qualifier,
java.lang.String key,
float value)
Sets a float in the
DefaultScope |
static void |
setDefaultInt(java.lang.String qualifier,
java.lang.String key,
int value)
Sets a integer in the
DefaultScope |
static void |
setDefaultLong(java.lang.String qualifier,
java.lang.String key,
long value)
Sets a long in the
DefaultScope |
static void |
setDefaultString(java.lang.String qualifier,
java.lang.String key,
java.lang.String value)
Sets a string in the
DefaultScope |
static void |
setDouble(java.lang.String qualifier,
java.lang.String key,
double value)
Sets a double preference in the
InstanceScope. |
static void |
setFloat(java.lang.String qualifier,
java.lang.String key,
float value)
Sets a float preference in the
InstanceScope. |
static void |
setInt(java.lang.String qualifier,
java.lang.String key,
int value)
Sets a integer preference in the
InstanceScope. |
static void |
setLong(java.lang.String qualifier,
java.lang.String key,
long value)
Sets a long preference in the
InstanceScope. |
static void |
setString(java.lang.String qualifier,
java.lang.String key,
java.lang.String value)
Sets a string preference in the
InstanceScope. |
static void |
setToDefault(java.lang.String qualifier,
java.lang.String key)
Sets the given preference to its default value.
|
public static void addPreferenceChangeListener(java.lang.String qualifier,
org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
DefaultScope and the InstanceScopequalifier - listener - public static boolean contains(java.lang.String qualifier,
java.lang.String name)
qualifier - name - public static boolean getBoolean(java.lang.String qualifier,
java.lang.String key)
qualifier - key - defaultvalue - public static byte[] getByteArray(java.lang.String qualifier,
java.lang.String key)
qualifier - key - defaultvalue - public static boolean getDefaultBoolean(java.lang.String qualifier,
java.lang.String key,
boolean defaultvalue)
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScopequalifier - key - defaultvalue - DefaultScope for the given
key, or the specified default value.public static byte[] getDefaultByteArray(java.lang.String qualifier,
java.lang.String key,
byte[] defaultvalue)
DefaultScope for the given key or the specified default value if
the key does not
appear in the DefaultScopequalifier - key - defaultvalue - DefaultScope for the
given key, or the specified default value.public static double getDefaultDouble(java.lang.String qualifier,
java.lang.String key,
double defaultvalue)
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScopequalifier - key - defaultvalue - DefaultScope for the given
key, or the specified default value.public static float getDefaultFloat(java.lang.String qualifier,
java.lang.String key,
float defaultvalue)
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScopequalifier - key - defaultvalue - DefaultScope for the given
key, or the specified default value.public static int getDefaultInt(java.lang.String qualifier,
java.lang.String key,
int defaultvalue)
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScopequalifier - key - defaultvalue - DefaultScope for the given
key, or the specified default value.public static long getDefaultLong(java.lang.String qualifier,
java.lang.String key,
long defaultvalue)
DefaultScope for the
given key or the specified default value if the key does not appear in
the DefaultScopequalifier - key - defaultvalue - DefaultScope for the given key,
or the specified default value.public static java.lang.String getDefaultString(java.lang.String qualifier,
java.lang.String key,
java.lang.String defaultvalue)
DefaultScope for
the given key or the specified default value if the key does not appear
in the DefaultScopequalifier - key - defaultvalue - DefaultScope for the given
key, or the specified default value.public static double getDouble(java.lang.String qualifier,
java.lang.String key)
qualifier - key - defaultvalue - public static float getFloat(java.lang.String qualifier,
java.lang.String key)
qualifier - key - defaultvalue - public static int getInt(java.lang.String qualifier,
java.lang.String key)
qualifier - key - defaultvalue - public static long getLong(java.lang.String qualifier,
java.lang.String key)
qualifier - key - defaultvalue - public static java.lang.String getString(java.lang.String qualifier,
java.lang.String key)
qualifier - key - defaultvalue - public static boolean isDefault(java.lang.String qualifier,
java.lang.String name)
qualifier - name - public static void removePreferenceChangeListener(java.lang.String qualifier,
org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
DefaultScope and
the InstanceScopequalifier - listener - public static void savePreferences(java.lang.String qualifier)
qualifier - public static void setBoolean(java.lang.String qualifier,
java.lang.String key,
boolean value)
InstanceScope.qualifier - key - the keyvalue - the valuepublic static void setByteArray(java.lang.String qualifier,
java.lang.String key,
byte[] value)
InstanceScope.qualifier - key - the keyvalue - the valuepublic static void setDefaultBoolean(java.lang.String qualifier,
java.lang.String key,
boolean value)
DefaultScopequalifier - key - the keyvalue - the new valuepublic static void setDefaultByteArray(java.lang.String qualifier,
java.lang.String key,
byte[] value)
DefaultScopequalifier - key - the keyvalue - the new valuepublic static void setDefaultDouble(java.lang.String qualifier,
java.lang.String key,
double value)
DefaultScopequalifier - key - the keyvalue - the new valuepublic static void setDefaultFloat(java.lang.String qualifier,
java.lang.String key,
float value)
DefaultScopequalifier - key - the keyvalue - the new valuepublic static void setDefaultInt(java.lang.String qualifier,
java.lang.String key,
int value)
DefaultScopequalifier - key - the keyvalue - the new valuepublic static void setDefaultLong(java.lang.String qualifier,
java.lang.String key,
long value)
DefaultScopequalifier - key - the keyvalue - the new valuepublic static void setDefaultString(java.lang.String qualifier,
java.lang.String key,
java.lang.String value)
DefaultScopequalifier - key - the keyvalue - the new valuepublic static void setDouble(java.lang.String qualifier,
java.lang.String key,
double value)
InstanceScope.qualifier - key - the keyvalue - the valuepublic static void setFloat(java.lang.String qualifier,
java.lang.String key,
float value)
InstanceScope.qualifier - key - the keyvalue - the valuepublic static void setInt(java.lang.String qualifier,
java.lang.String key,
int value)
InstanceScope.qualifier - key - the keyvalue - the valuepublic static void setLong(java.lang.String qualifier,
java.lang.String key,
long value)
InstanceScope.qualifier - key - the keyvalue - the valuepublic static void setString(java.lang.String qualifier,
java.lang.String key,
java.lang.String value)
InstanceScope.qualifier - key - the keyvalue - the valuepublic static void setToDefault(java.lang.String qualifier,
java.lang.String key)
InstanceScope. Has no effect if the given
key is null.qualifier - key - the key for the preferenceCopyright (c) 2011 IBM Corporation and others. All Rights Reserved.