com.opera.core.systems.preferences
Class OperaFilePreferences

java.lang.Object
  extended by com.opera.core.systems.preferences.AbstractOperaPreferences
      extended by 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.
 
Nested classes/interfaces inherited from class com.opera.core.systems.preferences.AbstractOperaPreferences
AbstractOperaPreferences.AbstractPreference
 
Nested classes/interfaces inherited from interface com.opera.core.systems.preferences.OperaPreferences
OperaPreferences.OperaPreference
 
Field Summary
 
Fields inherited from class com.opera.core.systems.preferences.AbstractOperaPreferences
preferences
 
Constructor Summary
OperaFilePreferences(File preferenceFile)
          Constructs a new representation of Opera's preferences based on the given preference file.
 
Method Summary
 void set(OperaPreferences.OperaPreference preference)
          Sets the given preference.
 void set(String section, String key, Object value)
          Sets the given preference information.
 void write()
          Call this to cause the current preferences representation to be written to disk.
 
Methods inherited from class com.opera.core.systems.preferences.AbstractOperaPreferences
all, get, iterator, merge, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

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-insensitive
key - the key name, can be case-insensitive
value - 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.