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(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 name)
Returns whether the named preference is know in the preference store.
|
static boolean |
getBoolean(java.lang.String key)
Returns the value in the preference store for the given key.
|
static byte[] |
getByteArray(java.lang.String key)
Returns the value in the preference store for the given key.
|
static boolean |
getDefaultBoolean(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 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 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 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 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 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 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 key)
Returns the value in the preference store for the given key.
|
static float |
getFloat(java.lang.String key)
Returns the value in the preference store for the given key.
|
static int |
getInt(java.lang.String key)
Returns the value in the preference store for the given key.
|
static long |
getLong(java.lang.String key)
Returns the value in the preference store for the given key.
|
static java.lang.String |
getString(java.lang.String key)
Returns the value in the preference store for the given key.
|
static boolean |
isDefault(java.lang.String name)
Returns true if the named preference has the default value.
|
static void |
removePreferenceChangeListener(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
Removes the given preference listener from the
DefaultScope and
the InstanceScope |
static void |
savePreferences()
Save the preferences for the given plugin identifier.
|
static void |
setBoolean(java.lang.String key,
boolean value)
Sets a boolean preference in the
InstanceScope . |
static void |
setByteArray(java.lang.String key,
byte[] value)
Sets a byte array preference in the
InstanceScope . |
static void |
setDefaultBoolean(java.lang.String key,
boolean value)
Sets a boolean in the
DefaultScope |
static void |
setDefaultByteArray(java.lang.String key,
byte[] value)
Sets a byte array in the
DefaultScope |
static void |
setDefaultDouble(java.lang.String key,
double value)
Sets a double in the
DefaultScope |
static void |
setDefaultFloat(java.lang.String key,
float value)
Sets a float in the
DefaultScope |
static void |
setDefaultInt(java.lang.String key,
int value)
Sets a integer in the
DefaultScope |
static void |
setDefaultLong(java.lang.String key,
long value)
Sets a long in the
DefaultScope |
static void |
setDefaultString(java.lang.String key,
java.lang.String value)
Sets a string in the
DefaultScope |
static void |
setDouble(java.lang.String key,
double value)
Sets a double preference in the
InstanceScope . |
static void |
setFloat(java.lang.String key,
float value)
Sets a float preference in the
InstanceScope . |
static void |
setInt(java.lang.String key,
int value)
Sets a integer preference in the
InstanceScope . |
static void |
setLong(java.lang.String key,
long value)
Sets a long preference in the
InstanceScope . |
static void |
setString(java.lang.String key,
java.lang.String value)
Sets a string preference in the
InstanceScope . |
static void |
setToDefault(java.lang.String key)
Sets the given preference to its default value.
|
public static void addPreferenceChangeListener(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
DefaultScope
and the InstanceScope
listener
- public static boolean contains(java.lang.String name)
name
- public static boolean getBoolean(java.lang.String key)
key
- defaultvalue
- public static byte[] getByteArray(java.lang.String key)
key
- defaultvalue
- public static boolean getDefaultBoolean(java.lang.String key, boolean defaultvalue)
DefaultScope
for
the given key or the specified default value if the key does not appear
in the DefaultScope
key
- defaultvalue
- DefaultScope
for the given
key, or the specified default value.public static byte[] getDefaultByteArray(java.lang.String key, byte[] defaultvalue)
DefaultScope
for the given key or the specified default value if
the key does not
appear in the DefaultScope
key
- defaultvalue
- DefaultScope
for the
given key, or the specified default value.public static double getDefaultDouble(java.lang.String key, double defaultvalue)
DefaultScope
for
the given key or the specified default value if the key does not appear
in the DefaultScope
key
- defaultvalue
- DefaultScope
for the given
key, or the specified default value.public static float getDefaultFloat(java.lang.String key, float defaultvalue)
DefaultScope
for
the given key or the specified default value if the key does not appear
in the DefaultScope
key
- defaultvalue
- DefaultScope
for the given
key, or the specified default value.public static int getDefaultInt(java.lang.String key, int defaultvalue)
DefaultScope
for
the given key or the specified default value if the key does not appear
in the DefaultScope
key
- defaultvalue
- DefaultScope
for the given
key, or the specified default value.public static long getDefaultLong(java.lang.String key, long defaultvalue)
DefaultScope
for the
given key or the specified default value if the key does not appear in
the DefaultScope
key
- defaultvalue
- DefaultScope
for the given key,
or the specified default value.public static java.lang.String getDefaultString(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 DefaultScope
key
- defaultvalue
- DefaultScope
for the given
key, or the specified default value.public static double getDouble(java.lang.String key)
key
- defaultvalue
- public static float getFloat(java.lang.String key)
fQualifier
- key
- defaultvalue
- public static int getInt(java.lang.String key)
fQualifier
- key
- defaultvalue
- public static long getLong(java.lang.String key)
key
- defaultvalue
- public static java.lang.String getString(java.lang.String key)
key
- defaultvalue
- public static boolean isDefault(java.lang.String name)
name
- public static void removePreferenceChangeListener(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
DefaultScope
and
the InstanceScope
listener
- public static void savePreferences()
public static void setBoolean(java.lang.String key, boolean value)
InstanceScope
.key
- the keyvalue
- the valuepublic static void setByteArray(java.lang.String key, byte[] value)
InstanceScope
.key
- the keyvalue
- the valuepublic static void setDefaultBoolean(java.lang.String key, boolean value)
DefaultScope
key
- the keyvalue
- the new valuepublic static void setDefaultByteArray(java.lang.String key, byte[] value)
DefaultScope
key
- the keyvalue
- the new valuepublic static void setDefaultDouble(java.lang.String key, double value)
DefaultScope
key
- the keyvalue
- the new valuepublic static void setDefaultFloat(java.lang.String key, float value)
DefaultScope
key
- the keyvalue
- the new valuepublic static void setDefaultInt(java.lang.String key, int value)
DefaultScope
key
- the keyvalue
- the new valuepublic static void setDefaultLong(java.lang.String key, long value)
DefaultScope
key
- the keyvalue
- the new valuepublic static void setDefaultString(java.lang.String key, java.lang.String value)
DefaultScope
key
- the keyvalue
- the new valuepublic static void setDouble(java.lang.String key, double value)
InstanceScope
.key
- the keyvalue
- the valuepublic static void setFloat(java.lang.String key, float value)
InstanceScope
.key
- the keyvalue
- the valuepublic static void setInt(java.lang.String key, int value)
InstanceScope
.key
- the keyvalue
- the valuepublic static void setLong(java.lang.String key, long value)
InstanceScope
.key
- the keyvalue
- the valuepublic static void setString(java.lang.String key, java.lang.String value)
InstanceScope
.key
- the keyvalue
- the valuepublic static void setToDefault(java.lang.String key)
InstanceScope
. Has no effect if the given
key is null
.key
- the key for the preference