public class PreferencesTools extends Object
IPreferences.| Modifier and Type | Field and Description |
|---|---|
static String |
ELEMENT_SEPARATOR |
static String |
KEY_VALUE_SEPARATOR |
| Modifier and Type | Method and Description |
|---|---|
static String |
fitKey(String name) |
static <T extends EnumItem> |
getEnumItem(IPreferences preferences,
EnumMeta<T> meta,
String name) |
static <T extends EnumItem> |
getEnumItem(IPreferences preferences,
EnumMeta<T> meta,
String name,
String defaultValue) |
static String |
getLarge(IPreferences preferences,
String name,
String defaultValue) |
static String |
getSecret(IPreferences preferences,
String name,
String defaultValue) |
static void |
importPreferences(IPreferences root,
IPreferences source) |
static void |
mergeArgs(IPreferences source,
IArgs args)
Add all argument bindings stored in source to args.
|
static void |
putArgs(IPreferences preferences,
IArgs args,
IDeclarationBlock block)
Serialize the declared argument bindings to a preferences node.
|
static void |
putArgsAll(IPreferences preferences,
IArgs args,
boolean secret)
Save all argument bindings in the preferences node.
|
static void |
putArgsDeclared(IPreferences preferences,
IArgs args,
IDeclarationElement[] declarations,
boolean secret)
Serialize the declared argument bindings to a preferences node.
|
static void |
putArgValue(IPreferences preferences,
String name,
Object pValue,
IArgumentDeclaration argDecl,
boolean secret)
Serialize a name/value pair in a preferences node.
|
static void |
putEnumItem(IPreferences preferences,
String name,
EnumItem item) |
static void |
putLarge(IPreferences preferences,
String name,
String longValue) |
static void |
putSecret(IPreferences preferences,
String name,
String value) |
static Rectangle |
toRect(String value) |
static Rectangle |
toRect(String value,
int[] ranges) |
static String |
toString(float[] value) |
static String |
toString(int[] value) |
static String |
toString(List value) |
static String |
toString(Map map) |
static String |
toString(Rectangle rect) |
static String |
toString(String[] value) |
static String[] |
toStringArray(String value) |
public static final String ELEMENT_SEPARATOR
public static final String KEY_VALUE_SEPARATOR
public static <T extends EnumItem> T getEnumItem(IPreferences preferences, EnumMeta<T> meta, String name)
public static <T extends EnumItem> T getEnumItem(IPreferences preferences, EnumMeta<T> meta, String name, String defaultValue)
public static String getLarge(IPreferences preferences, String name, String defaultValue)
public static String getSecret(IPreferences preferences, String name, String defaultValue)
public static void importPreferences(IPreferences root, IPreferences source) throws BackingStoreException
BackingStoreExceptionpublic static void mergeArgs(IPreferences source, IArgs args)
source - args - public static void putArgs(IPreferences preferences, IArgs args, IDeclarationBlock block)
This implementation does not remove any binding from preferences. If this is required, you should clear the preferences beforehand.
preferences - args - block - public static void putArgsAll(IPreferences preferences, IArgs args, boolean secret)
This implementation does not remove any binding from preferences. If this is required, you should clear the preferences beforehand.
preferences - args - secret - public static void putArgsDeclared(IPreferences preferences, IArgs args, IDeclarationElement[] declarations, boolean secret)
This implementation does not remove any binding from preferences. If this is required, you should clear the preferences beforehand.
preferences - args - declarations - public static void putArgValue(IPreferences preferences, String name, Object pValue, IArgumentDeclaration argDecl, boolean secret)
If value is itself an IArgs structure, argument serialization is
recursed.
preferences - name - pValue - argDecl - secret - public static void putEnumItem(IPreferences preferences, String name, EnumItem item)
public static void putLarge(IPreferences preferences, String name, String longValue)
public static void putSecret(IPreferences preferences, String name, String value)
public static String toString(float[] value)
public static String toString(int[] value)
Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.