de.matthiasmann.twl.model
Class PersistentBooleanModel

java.lang.Object
  extended by de.matthiasmann.twl.model.HasCallback
      extended by de.matthiasmann.twl.model.PersistentBooleanModel
All Implemented Interfaces:
BooleanModel, WithRunnableCallback

public class PersistentBooleanModel
extends HasCallback
implements BooleanModel

A model that stores a boolean value and supports callback on value change. The value can also be persisted using java.util.prefs.Preferences


Constructor Summary
PersistentBooleanModel(java.util.prefs.Preferences prefs, java.lang.String prefKey, boolean defaultValue)
           
 
Method Summary
 boolean getValue()
           
 void setValue(boolean value)
           
 
Methods inherited from class de.matthiasmann.twl.model.HasCallback
addCallback, doCallback, hasCallbacks, removeCallback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.matthiasmann.twl.utils.WithRunnableCallback
addCallback, removeCallback
 

Constructor Detail

PersistentBooleanModel

public PersistentBooleanModel(java.util.prefs.Preferences prefs,
                              java.lang.String prefKey,
                              boolean defaultValue)
Method Detail

getValue

public boolean getValue()
Specified by:
getValue in interface BooleanModel

setValue

public void setValue(boolean value)
Specified by:
setValue in interface BooleanModel