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