com.opera.core.systems.preferences
Class OperaScopePreferences.ScopePreference

java.lang.Object
  extended by com.opera.core.systems.preferences.AbstractOperaPreferences.AbstractPreference
      extended by com.opera.core.systems.preferences.OperaScopePreferences.ScopePreference
All Implemented Interfaces:
OperaPreferences.OperaPreference
Enclosing class:
OperaScopePreferences

public static class OperaScopePreferences.ScopePreference
extends AbstractOperaPreferences.AbstractPreference

Allows setting Opera preferences in Opera in addition to keeping the local cache of preferences up to date.


Field Summary
 
Fields inherited from class com.opera.core.systems.preferences.AbstractOperaPreferences.AbstractPreference
defaultValue
 
Constructor Summary
OperaScopePreferences.ScopePreference(OperaScopePreferences parent, PrefsProtos.Pref pref)
           
 
Method Summary
 Object getDefaultValue()
          Gets the default value of the preference.
 Type getType()
          Returns which type the preference is considered internally in Opera.
 boolean isEnabled()
          Whether setting is overriden by global INI.
 void reset()
          Resets preference's value to its default value.
 void setValue(Object value)
          Sets the value of this preference.
 
Methods inherited from class com.opera.core.systems.preferences.AbstractOperaPreferences.AbstractPreference
getKey, getSection, getValue, getValue, isTruthy, sanitizeValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OperaScopePreferences.ScopePreference

public OperaScopePreferences.ScopePreference(OperaScopePreferences parent,
                                             PrefsProtos.Pref pref)
Method Detail

setValue

public void setValue(Object value)
Description copied from interface: OperaPreferences.OperaPreference
Sets the value of this preference.

Specified by:
setValue in interface OperaPreferences.OperaPreference
Overrides:
setValue in class AbstractOperaPreferences.AbstractPreference
Parameters:
value - the new value

getDefaultValue

public Object getDefaultValue()
Description copied from interface: OperaPreferences.OperaPreference
Gets the default value of the preference.

Specified by:
getDefaultValue in interface OperaPreferences.OperaPreference
Overrides:
getDefaultValue in class AbstractOperaPreferences.AbstractPreference
Returns:
the default value of this preference

getType

public Type getType()
Returns which type the preference is considered internally in Opera.

Returns:
Integer, String or Boolean type

isEnabled

public boolean isEnabled()
Whether setting is overriden by global INI. If this value is missing, it means global INI is not supported.

Returns:
true if enabled, false otherwise

reset

public void reset()
Resets preference's value to its default value. This method is a short-hand method for doing preference.setValue(preference.getDefaultValue).



Copyright © 2012. All Rights Reserved.