public class SDMPropertyChangeEvent extends SDMModelEvent
SDMPropertyChangeEvent
are sent to SDMModelListener
s
by an IlvSDMModel
when one or more
properties of a data object have changed.Modifier and Type | Field and Description |
---|---|
static String |
OBJECT_ID
This string is passed as the property name
when the
SDMPropertyChangeEvent
notifies the listeners that the ID of an object has changed. |
source
Constructor and Description |
---|
SDMPropertyChangeEvent(Object source,
Object object,
boolean adjusting,
String[] propertyNames,
Object[] oldValues,
Object[] newValues)
Creates a new
SDMPropertyChangeEvent for multiple
simultaneous property changes. |
SDMPropertyChangeEvent(Object source,
Object object,
boolean adjusting,
String propertyName,
Object oldValue,
Object newValue)
Creates a new
SDMPropertyChangeEvent for a single property
change or for an unspecified set of property changes. |
Modifier and Type | Method and Description |
---|---|
Object |
getNewValue()
Returns the new value of the primary property,
or
null if an unspecified set of properties has changed. |
Object[] |
getNewValues()
Returns the new values of the properties.
|
Object |
getOldValue()
Returns the old value of the primary property,
or
null if an unspecified set of properties has changed. |
Object[] |
getOldValues()
Returns the old values of the properties.
|
String |
getPropertyName()
Returns the name of the primary property that has been modified,
or
null if an unspecified set of properties has changed. |
String[] |
getPropertyNames()
Returns the names of the properties that have been modified,
or
null if an unspecified set of properties has changed. |
getModel, getObject, isAdjusting
getSource, toString
public static final String OBJECT_ID
SDMPropertyChangeEvent
notifies the listeners that the ID of an object has changed.
This string is initialized to new String("id")
,
so you can test it safely using the expression:
event.getPropertyName() == SDMPropertyChangeEvent.OBJECT_ID
public SDMPropertyChangeEvent(Object source, Object object, boolean adjusting, String propertyName, Object oldValue, Object newValue)
SDMPropertyChangeEvent
for a single property
change or for an unspecified set of property changes.source
- The event source.object
- The application object
whose property has been changed.adjusting
- A flag that indicates whether the modification is
part of a series of related modifications. This flag is set
to the value passed during the last call to the model's
IlvSDMModel.setAdjusting(boolean)
method.propertyName
- The name of the property that has been modified,
or null
if an unspecified set of properties has changed.oldValue
- The old value of the property,
or null
if an unspecified set of properties has changed.newValue
- The new value of the property,
or null
if an unspecified set of properties has changed.public SDMPropertyChangeEvent(Object source, Object object, boolean adjusting, String[] propertyNames, Object[] oldValues, Object[] newValues)
SDMPropertyChangeEvent
for multiple
simultaneous property changes.source
- The event source.object
- The application object
whose properties have been changed.adjusting
- A flag that indicates whether the modification is
part of a series of related modifications. This flag is set
to the value passed during the last call to the model's
IlvSDMModel.setAdjusting(boolean)
method.propertyNames
- The names of the properties that have been modified.
It must be a non-empty array.oldValues
- The old values of the properties.
It must be an array of the same length as propertyNames
.newValues
- The new values of the properties.
It must be an array of the same length as propertyNames
.public String getPropertyName()
null
if an unspecified set of properties has changed.
If the event notifies the listeners that the ID of an object has changed,
the property name is set to OBJECT_ID
.getPropertyNames()
public Object getOldValue()
null
if an unspecified set of properties has changed.public Object getNewValue()
null
if an unspecified set of properties has changed.public String[] getPropertyNames()
null
if an unspecified set of properties has changed.
If the ID of an object has changed, the property name used to designate
this change is OBJECT_ID
.null
for an unspecified set of property changes.getPropertyName()
public Object[] getOldValues()
getPropertyNames()
, or
null
for an unspecified set of property changes.public Object[] getNewValues()
getPropertyNames()
, or
null
for an unspecified set of property changes.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.