com.opera.core.systems.preferences
Class OperaFilePreferences
java.lang.Object
com.opera.core.systems.preferences.AbstractOperaPreferences
com.opera.core.systems.preferences.OperaFilePreferences
- All Implemented Interfaces:
- OperaPreferences, Iterable<OperaPreferences.OperaPreference>
public class OperaFilePreferences
- extends AbstractOperaPreferences
OperaFilePreferences allows updating preferences in an Opera preference file such as
opera.ini or operaprefs.ini. The file will be written to upon each
alteration to any preference.
|
Nested Class Summary |
static class |
OperaFilePreferences.FilePreference
Allows setting Opera preferences in a preference file (typically opera.ini or
operaprefs.ini) as well as keeping the local individual preference cache
up-to-date. |
|
Constructor Summary |
OperaFilePreferences(File preferenceFile)
Constructs a new representation of Opera's preferences based on the given preference file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OperaFilePreferences
public OperaFilePreferences(File preferenceFile)
- Constructs a new representation of Opera's preferences based on the given preference file.
- Parameters:
preferenceFile - an INI style preference file
set
public void set(String section,
String key,
Object value)
- Description copied from interface:
OperaPreferences
- Sets the given preference information. If a previous preference with the same section and key
names exist, it will be replaced by the given preference.
This is a shortcut for the
OperaPreferences.set(OperaPreference) method.
- Specified by:
set in interface OperaPreferences- Overrides:
set in class AbstractOperaPreferences
- Parameters:
section - the section name, can be case-insensitivekey - the key name, can be case-insensitivevalue - the new value (will be treated as a String in Opera
set
public void set(OperaPreferences.OperaPreference preference)
- Description copied from interface:
OperaPreferences
- Sets the given preference. If a previous preference with the same section and key names exist,
it will be replaced by the given preference.
- Specified by:
set in interface OperaPreferences- Overrides:
set in class AbstractOperaPreferences
- Parameters:
preference - the preference to add or update
write
public void write()
- Call this to cause the current preferences representation to be written to disk. This method
is called by
OperaFilePreferences.FilePreference.setValue(Object) and it is thus not necessary to call this
method separately unless you wish to perform a forced write of the cache to disk.
Copyright © 2012. All Rights Reserved.