|
Oracle Fusion Middleware Java API Reference for Oracle Help 12c (12.1.2) E48720-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.help.viewer.PreferenceManager
public class PreferenceManager
The PreferenceManager class provides a generic way of maintaining a collection of preferences. The PreferenceManager supplies loadPreferences for loading preferences from an XML file, and savePreferences for committing the currently selected preferences to disk. setFilename is used to specify the name of the file which is associated with the PreferenceManager. Preferences may also be set explicitly through setPreference, or setPreferenceNoClobber which will not override a currently existing preference.
Field Summary | |
---|---|
static java.lang.String |
CLOSE |
static java.lang.String |
COMMENT |
static java.lang.String |
EQUALS |
static java.lang.String |
INDENT |
static java.lang.String |
NAME |
static java.lang.String |
OPEN |
static java.lang.String |
PREF |
static java.lang.String |
PREFERENCES |
static java.lang.String |
QUEST |
static java.lang.String |
QUOTE |
static java.lang.String |
SLASH |
static java.lang.String |
SPACE |
static java.lang.String |
VALUE |
static java.lang.String |
XML |
Constructor Summary | |
---|---|
PreferenceManager() |
Method Summary | |
---|---|
static java.lang.String |
getPreference(java.lang.String name) Retrieve the value of a preference. |
static void |
loadPreferences() Load the preferences from the file currently associated with the preference manager. |
static void |
savePreferences() Save the preferences to the file currently associated with the preference manager in XML format. |
static void |
setFilename(java.lang.String filename) Sets the file associated with the preference manager |
static void |
setPreference(java.lang.String name, java.lang.String value) Add a preference (a name/value pair) to the current set of preferences. |
static void |
setPreferenceNoClobber(java.lang.String name, java.lang.String value) If no preference of the given name exists in the set of preferences already, then create it and set its value; otherwise leave the existing preference alone. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PREFERENCES
public static final java.lang.String PREF
public static final java.lang.String NAME
public static final java.lang.String VALUE
public static final java.lang.String OPEN
public static final java.lang.String CLOSE
public static final java.lang.String SLASH
public static final java.lang.String INDENT
public static final java.lang.String SPACE
public static final java.lang.String EQUALS
public static final java.lang.String QUOTE
public static final java.lang.String QUEST
public static final java.lang.String XML
public static final java.lang.String COMMENT
Constructor Detail |
---|
public PreferenceManager()
Method Detail |
---|
public static void setFilename(java.lang.String filename)
filename
- the name of the file from which the PreferenceManager will hereafter attempt to read preferences from and write preferences topublic static void loadPreferences()
public static void savePreferences()
public static void setPreference(java.lang.String name, java.lang.String value)
name
- The name of the preference which is being set.value
- The value of the preference.public static void setPreferenceNoClobber(java.lang.String name, java.lang.String value)
name
- The name of the preference which is being set.value
- The value of the preference.public static java.lang.String getPreference(java.lang.String name)
name
- The name of a preference already in the preference set.
|
Oracle Fusion Middleware Java API Reference for Oracle Help 12c (12.1.2) E48720-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |