Package org.hortonmachine.gears.utils
Class PreferencesHandler
- java.lang.Object
-
- org.hortonmachine.gears.utils.PreferencesHandler
-
public class PreferencesHandler extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringHM_PREF_PROXYCHECKstatic StringHM_PREF_PROXYHOSTstatic StringHM_PREF_PROXYPORTstatic StringHM_PREF_PROXYPWDstatic StringHM_PREF_PROXYUSERstatic StringHM_PREF_SHP_CHARSETstatic StringLAST_PATHstatic StringLEFT_TO_RIGHTstatic StringPREF_ORIENTATIONstatic StringPREF_STRING_SEPARATORSstatic StringPREFS_NODE_NAMEstatic StringRIGHT_TO_LEFT
-
Constructor Summary
Constructors Constructor Description PreferencesHandler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ComponentOrientationgetComponentOrientation()static FilegetLastFile()Handle the last set path preference.static byte[]getPreference(String preferenceKey, byte[] defaultValue)static StringgetPreference(String preferenceKey, String defaultValue)Get from preference.static String[]getPreference(String preferenceKey, String[] defaultValue)static StringgetShpCharset()static StringgetShpDoIndex()static voidsaveComponentOrientation(ComponentOrientation orientation)static voidsaveComponentOrientation(String orientationString)static voidsetLastPath(String lastPath)Save the passed path as last path available.static voidsetPreference(String preferenceKey, byte[] value)static voidsetPreference(String preferenceKey, String value)Set a preference.static voidsetPreference(String preferenceKey, String[] valuesArray)
-
-
-
Field Detail
-
HM_PREF_PROXYPWD
public static final String HM_PREF_PROXYPWD
- See Also:
- Constant Field Values
-
HM_PREF_PROXYUSER
public static final String HM_PREF_PROXYUSER
- See Also:
- Constant Field Values
-
HM_PREF_PROXYPORT
public static final String HM_PREF_PROXYPORT
- See Also:
- Constant Field Values
-
HM_PREF_PROXYHOST
public static final String HM_PREF_PROXYHOST
- See Also:
- Constant Field Values
-
HM_PREF_PROXYCHECK
public static final String HM_PREF_PROXYCHECK
- See Also:
- Constant Field Values
-
HM_PREF_SHP_CHARSET
public static final String HM_PREF_SHP_CHARSET
- See Also:
- Constant Field Values
-
PREFS_NODE_NAME
public static final String PREFS_NODE_NAME
- See Also:
- Constant Field Values
-
LAST_PATH
public static final String LAST_PATH
- See Also:
- Constant Field Values
-
PREF_STRING_SEPARATORS
public static final String PREF_STRING_SEPARATORS
- See Also:
- Constant Field Values
-
PREF_ORIENTATION
public static final String PREF_ORIENTATION
- See Also:
- Constant Field Values
-
LEFT_TO_RIGHT
public static final String LEFT_TO_RIGHT
- See Also:
- Constant Field Values
-
RIGHT_TO_LEFT
public static final String RIGHT_TO_LEFT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLastFile
public static File getLastFile()
Handle the last set path preference.- Returns:
- the last set path or the user home.
-
setLastPath
public static void setLastPath(String lastPath)
Save the passed path as last path available.- Parameters:
lastPath- the last path to save.
-
getPreference
public static String getPreference(String preferenceKey, String defaultValue)
Get from preference.- Parameters:
preferenceKey- the preference key.defaultValue- the default value in case ofnull.- Returns:
- the string preference asked.
-
getPreference
public static byte[] getPreference(String preferenceKey, byte[] defaultValue)
-
setPreference
public static void setPreference(String preferenceKey, String value)
Set a preference.- Parameters:
preferenceKey- the preference key.value- the value to set.
-
setPreference
public static void setPreference(String preferenceKey, byte[] value)
-
getShpCharset
public static String getShpCharset()
-
getComponentOrientation
public static ComponentOrientation getComponentOrientation()
-
saveComponentOrientation
public static void saveComponentOrientation(ComponentOrientation orientation)
-
saveComponentOrientation
public static void saveComponentOrientation(String orientationString)
-
getShpDoIndex
public static String getShpDoIndex()
-
-