Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Help
12c (12.1.2)

E48720-01


oracle.help.viewer
Class PreferenceManager

java.lang.Object
  extended by oracle.help.viewer.PreferenceManager


public class PreferenceManager
extends java.lang.Object

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

PREFERENCES

public static final java.lang.String PREFERENCES
See Also:
Constant Field Values

PREF

public static final java.lang.String PREF
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

VALUE

public static final java.lang.String VALUE
See Also:
Constant Field Values

OPEN

public static final java.lang.String OPEN
See Also:
Constant Field Values

CLOSE

public static final java.lang.String CLOSE
See Also:
Constant Field Values

SLASH

public static final java.lang.String SLASH
See Also:
Constant Field Values

INDENT

public static final java.lang.String INDENT
See Also:
Constant Field Values

SPACE

public static final java.lang.String SPACE
See Also:
Constant Field Values

EQUALS

public static final java.lang.String EQUALS
See Also:
Constant Field Values

QUOTE

public static final java.lang.String QUOTE
See Also:
Constant Field Values

QUEST

public static final java.lang.String QUEST
See Also:
Constant Field Values

XML

public static final java.lang.String XML
See Also:
Constant Field Values

COMMENT

public static final java.lang.String COMMENT
See Also:
Constant Field Values

Constructor Detail

PreferenceManager

public PreferenceManager()

Method Detail

setFilename

public static void setFilename(java.lang.String filename)
Sets the file associated with the preference manager
Parameters:
filename - the name of the file from which the PreferenceManager will hereafter attempt to read preferences from and write preferences to

loadPreferences

public static void loadPreferences()
Load the preferences from the file currently associated with the preference manager.

savePreferences

public static void savePreferences()
Save the preferences to the file currently associated with the preference manager in XML format.

setPreference

public static void setPreference(java.lang.String name,
                                 java.lang.String value)
Add a preference (a name/value pair) to the current set of preferences.
Parameters:
name - The name of the preference which is being set.
value - The value of the preference.

setPreferenceNoClobber

public 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. This is useful for specifying defaults.
Parameters:
name - The name of the preference which is being set.
value - The value of the preference.

getPreference

public static java.lang.String getPreference(java.lang.String name)
Retrieve the value of a preference.
Parameters:
name - The name of a preference already in the preference set.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Help
12c (12.1.2)

E48720-01


Copyright © 1998, 2013, Oracle. All Rights Reserved.