com.opera.core.systems.preferences
Class OperaScopePreferences

java.lang.Object
  extended by com.opera.core.systems.preferences.AbstractOperaPreferences
      extended by com.opera.core.systems.preferences.OperaScopePreferences
All Implemented Interfaces:
OperaPreferences, Iterable<OperaPreferences.OperaPreference>

public class OperaScopePreferences
extends AbstractOperaPreferences

OperaScopePreferences allows updating preferences inside Opera using the Scope protocol using the common OperaPreferences interface. The prefs service will be written to upon alteration of any preference.

See Also:
OperaFilePreferences

Nested Class Summary
static class OperaScopePreferences.ScopePreference
          Allows setting Opera preferences in Opera in addition to keeping the local cache of preferences 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
protected  IPrefs service
           
 
Fields inherited from class com.opera.core.systems.preferences.AbstractOperaPreferences
preferences
 
Constructor Summary
OperaScopePreferences(IPrefs prefsService)
           
 
Method Summary
 OperaScopePreferences.ScopePreference get(String section, String key)
          Returns the preference with the given section and key values.
 void resetAll()
          Resets all preferences' values to their default value.
 void set(OperaPreferences.OperaPreference preference)
          Sets the given preference.
 void set(String section, String key, Object value)
          Sets the given preference information.
 
Methods inherited from class com.opera.core.systems.preferences.AbstractOperaPreferences
all, iterator, merge, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

service

protected IPrefs service
Constructor Detail

OperaScopePreferences

public OperaScopePreferences(IPrefs prefsService)
Method Detail

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

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

get

public OperaScopePreferences.ScopePreference get(String section,
                                                 String key)
Description copied from interface: OperaPreferences
Returns the preference with the given section and key values.

Specified by:
get in interface OperaPreferences
Overrides:
get in class AbstractOperaPreferences
Parameters:
section - the section name, can be case-insensitive
key - the key name, can be case-insensitive
Returns:
the preference requested

resetAll

public void resetAll()
Resets all preferences' values to their default value.



Copyright © 2012. All Rights Reserved.