java.lang.Object
de.edgesoft.edgeutils.files.Prefs
public class Prefs
extends java.lang.Object
Preferences.
Legal stuff
Copyright 2010-2020 Ekkart Kleinod ekleinod@edgesoft.de
This file is part of edgeutils.
edgeutils is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
edgeutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with edgeutils. If not, see http://www.gnu.org/licenses/.
- Since:
- 0.12.0
- Version:
- 0.13.0
- Author:
- Ekkart Kleinod
-
Field Summary
Fields Modifier and Type Field Description static intSIZE_ALERTAlert image size.static intSIZE_BUTTONButton size - normal.static intSIZE_BUTTON_SMALLButton size - small.static intSIZE_FLAGFlag size. -
Constructor Summary
Constructors Constructor Description Prefs() -
Method Summary
Modifier and Type Method Description static voidexportPrefs(java.io.OutputStream theStream)Exports preferences.static java.lang.Stringget(java.lang.String theKey)Get preference value for text key, default "".static java.lang.Stringget(java.lang.String theKey, java.lang.String theDefault)Get preference value for text key.static java.util.prefs.PreferencesgetPrefs()Returns preferences.static java.util.Map<java.lang.String,java.lang.Object>getPrefsMap()Returns preferences map.static voidimportPrefs(java.io.InputStream theStream)Imports preferences.static voidinit(java.lang.Class<? extends java.lang.Object> theProvider)Initializes class.static voidput(java.lang.String theKey, java.lang.String theValue)Set preference value for text key.
-
Field Details
-
SIZE_BUTTON
public static final int SIZE_BUTTONButton size - normal.- See Also:
- Constant Field Values
-
SIZE_BUTTON_SMALL
public static final int SIZE_BUTTON_SMALLButton size - small.- See Also:
- Constant Field Values
-
SIZE_ALERT
public static final int SIZE_ALERTAlert image size.- See Also:
- Constant Field Values
-
SIZE_FLAG
public static final int SIZE_FLAGFlag size.- See Also:
- Constant Field Values
-
-
Constructor Details
-
Prefs
public Prefs()
-
-
Method Details
-
init
public static void init(java.lang.Class<? extends java.lang.Object> theProvider)Initializes class.- Parameters:
theProvider- providing class
-
getPrefs
public static java.util.prefs.Preferences getPrefs()Returns preferences.- Returns:
- preferences
-
put
public static void put(java.lang.String theKey, java.lang.String theValue)Set preference value for text key.- Parameters:
theKey- text keytheValue- value
-
get
public static java.lang.String get(java.lang.String theKey)Get preference value for text key, default "".- Parameters:
theKey- text key- Returns:
- value
-
get
public static java.lang.String get(java.lang.String theKey, java.lang.String theDefault)Get preference value for text key.- Parameters:
theKey- text keytheDefault- default value- Returns:
- value
-
exportPrefs
public static void exportPrefs(java.io.OutputStream theStream) throws java.io.IOException, java.util.prefs.BackingStoreExceptionExports preferences.- Parameters:
theStream- output stream- Throws:
java.util.prefs.BackingStoreExceptionjava.io.IOException
-
importPrefs
public static void importPrefs(java.io.InputStream theStream) throws java.io.IOException, java.util.prefs.InvalidPreferencesFormatException, java.util.prefs.BackingStoreExceptionImports preferences.- Parameters:
theStream- input stream- Throws:
java.io.IOExceptionjava.util.prefs.InvalidPreferencesFormatExceptionjava.util.prefs.BackingStoreException
-
getPrefsMap
public static java.util.Map<java.lang.String,java.lang.Object> getPrefsMap() throws java.util.prefs.BackingStoreExceptionReturns preferences map.- Returns:
- preferences map
- Throws:
java.util.prefs.BackingStoreException
-