|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAbstractBean
com.jgoodies.binding.beans.Model
public abstract class Model
An abstract superclass that minimizes the effort required to provide change support for bound and constrained Bean properties. This class follows the conventions and recommendations as described in the Java Bean Specification.
Uses class ExtendedPropertyChangeSupport
,
to enable the ==
or #equals
test when
changing values.
TODO: Consider adding a method #fireChange
that invokes
#firePropertyChange
if and only if
new value != old value
. The background is, that
#firePropertyChange
must fire an event
if new value==null==old value
.
TODO: Consider renaming this class to AbstractBean. That better describes what this class is about.
Observable
,
PropertyChangeEvent
,
PropertyChangeListener
,
PropertyChangeSupport
,
ExtendedPropertyChangeSupport
,
VetoableChangeListener
,
VetoableChangeSupport
Constructor Summary | |
---|---|
Model()
|
Method Summary | |
---|---|
protected java.beans.PropertyChangeSupport |
createPropertyChangeSupport(java.lang.Object bean)
Creates and returns a PropertyChangeSupport for the given bean. |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue,
boolean checkIdentity)
Support for reporting bound property changes for Object properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jgoodies.binding.beans.Observable |
---|
addPropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
---|
public Model()
Method Detail |
---|
protected java.beans.PropertyChangeSupport createPropertyChangeSupport(java.lang.Object bean)
Observable.addPropertyChangeListener(java.beans.PropertyChangeListener)
when lazily creating the sole change support instance used throughout
this bean.
This implementation creates an extended change support that allows
to configure whether the old and new value are compared with
==
or equals
.
bean
- the bean to create a change support for
protected final void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue, boolean checkIdentity)
The boolean parameter specifies whether the old and new value are
compared with ==
or equals
.
propertyName
- the property whose value has changedoldValue
- the property's previous valuenewValue
- the property's new valuecheckIdentity
- true to check differences using ==
false to use equals
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |