|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.doolin.gui.util.PreferencesUtils
public class PreferencesUtils
Utility methods for the GUIPreferences that extends the number of
types that can be stored and retrieved.
| Method Summary | ||
|---|---|---|
static BigDecimal |
getBigDecimal(GUIPreferences preferences,
String key,
BigDecimal defaultValue)
Retrieves a BigDecimal from the preferences. |
|
static Color |
getColor(GUIPreferences preferences,
String key,
Color defaultColor)
Retrieves a Color from the preferences. |
|
static
|
getEnum(GUIPreferences preferences,
String prefKey,
Class<E> eClass,
E defaultValue)
Retrieves a Enum from the preferences. |
|
static Font |
getFont(GUIPreferences preferences,
String key,
Font defaultFont)
Retrieves a Font from the preferences. |
|
static
|
getObject(GUIPreferences preferences,
String key)
Retrieves a Serializable object from the preferences. |
|
static Collection<String> |
getStringArray(GUIPreferences preferences,
String key)
Retrieves a collection of strings from the preferences. |
|
static void |
setBigDecimal(GUIPreferences preferences,
String key,
BigDecimal value)
Stores a BigDecimal in the preferences |
|
static void |
setColor(GUIPreferences preferences,
String key,
Color color)
Stores a Color in the preferences |
|
static
|
setEnum(GUIPreferences preferences,
String prefKey,
Enum<E> e)
Stores a Enum in the preferences |
|
static void |
setFont(GUIPreferences preferences,
String key,
Font font)
Stores a Font in the preferences |
|
static void |
setObject(GUIPreferences preferences,
String key,
Serializable object)
Stores a Serializable object in the preferences |
|
static void |
setStringArray(GUIPreferences preferences,
String key,
Collection<String> strings)
Stores a collection of strings in the preferences |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static BigDecimal getBigDecimal(GUIPreferences preferences,
String key,
BigDecimal defaultValue)
BigDecimal from the preferences.
preferences - Preferenceskey - KeydefaultValue - Default value if not found
BigDecimal or the default value
public static Color getColor(GUIPreferences preferences,
String key,
Color defaultColor)
Color from the preferences.
preferences - Preferenceskey - KeydefaultColor - Default value if not found
Color or the default valueColorEditor.parseColor(String)
public static <E extends Enum<E>> E getEnum(GUIPreferences preferences,
String prefKey,
Class<E> eClass,
E defaultValue)
Enum from the preferences.
E - Type of the enumerationpreferences - PreferencesprefKey - KeyeClass - Class of the enumerationdefaultValue - Default value if not found
BigDecimal or the default value
public static Font getFont(GUIPreferences preferences,
String key,
Font defaultFont)
Font from the preferences.
preferences - Preferenceskey - KeydefaultFont - Default value if not found
Font or the default value
public static <T extends Serializable> T getObject(GUIPreferences preferences,
String key)
Serializable object from the preferences.
T - Type of the Serializable objectpreferences - Preferenceskey - Key
BigDecimal or null
public static Collection<String> getStringArray(GUIPreferences preferences,
String key)
preferences - Preferenceskey - Key
public static void setBigDecimal(GUIPreferences preferences,
String key,
BigDecimal value)
BigDecimal in the preferences
preferences - Preferenceskey - Keyvalue - Value to store
public static void setColor(GUIPreferences preferences,
String key,
Color color)
Color in the preferences
preferences - Preferenceskey - Keycolor - Value to store
public static <E extends Enum<E>> void setEnum(GUIPreferences preferences,
String prefKey,
Enum<E> e)
Enum in the preferences
E - Type of the enumerationpreferences - PreferencesprefKey - Keye - Value to store
public static void setFont(GUIPreferences preferences,
String key,
Font font)
Font in the preferences
preferences - Preferenceskey - Keyfont - Value to store
public static void setObject(GUIPreferences preferences,
String key,
Serializable object)
Serializable object in the preferences
preferences - Preferenceskey - Keyobject - Value to store
public static void setStringArray(GUIPreferences preferences,
String key,
Collection<String> strings)
preferences - Preferenceskey - Keystrings - Values to store
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||