de.matthiasmann.twl.model
Class AbstractProperty<T>

java.lang.Object
  extended by de.matthiasmann.twl.model.AbstractProperty<T>
Type Parameters:
T - The type of the property value
All Implemented Interfaces:
Property<T>
Direct Known Subclasses:
SimpleProperty, SimplePropertyList

public abstract class AbstractProperty<T>
extends java.lang.Object
implements Property<T>

An abstract base class for Properties. Provides callback handling.


Constructor Summary
AbstractProperty()
           
 
Method Summary
 void addValueChangedCallback(java.lang.Runnable cb)
          Registers a value changed callback.
protected  void fireValueChangedCallback()
           
 boolean hasValueChangedCallbacks()
           
 void removeValueChangedCallback(java.lang.Runnable cb)
          Removes a value changed callback
 
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.model.Property
canBeNull, getName, getPropertyValue, getType, isReadOnly, setPropertyValue
 

Constructor Detail

AbstractProperty

public AbstractProperty()
Method Detail

addValueChangedCallback

public void addValueChangedCallback(java.lang.Runnable cb)
Description copied from interface: Property
Registers a value changed callback. It should be called when the value was changed from something other then setValue

Specified by:
addValueChangedCallback in interface Property<T>
Parameters:
cb - the value changed callback

removeValueChangedCallback

public void removeValueChangedCallback(java.lang.Runnable cb)
Description copied from interface: Property
Removes a value changed callback

Specified by:
removeValueChangedCallback in interface Property<T>
Parameters:
cb - the value changed callback

hasValueChangedCallbacks

public boolean hasValueChangedCallbacks()

fireValueChangedCallback

protected void fireValueChangedCallback()