public abstract class Model
extends com.jgoodies.common.bean.Bean
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
.
Model
,
PropertyChangeEvent
,
PropertyChangeListener
,
PropertyChangeSupport
,
ExtendedPropertyChangeSupport
,
VetoableChangeListener
,
VetoableChangeSupport
,
Serialized FormConstructor and Description |
---|
Model() |
Modifier and Type | Method and Description |
---|---|
protected PropertyChangeSupport |
createPropertyChangeSupport(Object bean)
Creates and returns a PropertyChangeSupport for the given bean.
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue,
boolean checkIdentity)
Support for reporting bound property changes for Object properties.
|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
protected PropertyChangeSupport createPropertyChangeSupport(Object bean)
Bean.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
.
createPropertyChangeSupport
in class com.jgoodies.common.bean.Bean
bean
- the bean to create a change support forprotected final void firePropertyChange(String propertyName, Object oldValue, 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
.Copyright © 2002-2015 JGoodies Software GmbH. All Rights Reserved.