Class PropertyStateEvent
java.lang.Object
java.util.EventObject
org.jdesktop.beansbinding.PropertyStateEvent
- All Implemented Interfaces:
Serializable
An event characterizing a change in a
Property's state for
a particular source object.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ObjectUsed to indicate that a particular value is unreadable.Fields inherited from class EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionPropertyStateEvent(Property sourceProperty, Object sourceObject, boolean valueChanged, Object oldValue, Object newValue, boolean writeableChanged, boolean isWriteable) Creates an instance ofPropertyStateEventcharacterizing a change in aProperty'sstate for a particular source object. -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectReturns the new value of thePropertyfor the source object, orUNREADABLEif thePropertyis not currently readable for the source object.final ObjectReturns the old value of thePropertyfor the source object, orUNREADABLEif thePropertywas not previously readable for the source object.final booleanReturns whether or not theProperty'sreadability has changed for the source object.final ObjectReturns thePropertywhose state has changed.final ObjectReturns the source object for which theProperty'sstate has changed.final PropertyReturns thePropertywhose state has changed.final booleanReturns whether or not theProperty'svalue has changed for the source object.final booleanReturns whether or not theProperty'swriteability has changed for the source object.final booleanReturns whether or not thePropertyis currently readable for the source object.final booleanReturns whether or not thePropertyis currently writeable for the source object.toString()Returns a string representation of thePropertyStateEvent.
-
Field Details
-
UNREADABLE
Used to indicate that a particular value is unreadable.
-
-
Constructor Details
-
PropertyStateEvent
public PropertyStateEvent(Property sourceProperty, Object sourceObject, boolean valueChanged, Object oldValue, Object newValue, boolean writeableChanged, boolean isWriteable) Creates an instance ofPropertyStateEventcharacterizing a change in aProperty'sstate for a particular source object.Note: To indicate a change in readability, specify
valueChangedastrueand reflect the readability status in theoldValueandnewValuearguments.- Parameters:
sourceProperty- thePropertywhose state has changedsourceObject- the source object for which theProperty'sstate has changedvalueChanged- whether or not theProperty'svalue has changed for the source objectoldValue- the old value of thePropertyfor the source object, orUNREADABLEif thePropertywas not previously readable for the source objectnewValue- the new value of thePropertyfor the source object, orUNREADABLEif thePropertyis not currently readable for the source objectwriteableChanged- whether or not theProperty'swriteability has changed for the source objectisWriteable- whether or not thePropertyis now writeable for the source object- Throws:
IllegalArgumentException- if neither the value or the writeability has changedIllegalArgumentException- ifvalueChangedistrueand botholdValueandnewValueareUNREADABLE
-
-
Method Details
-
getSource
Returns thePropertywhose state has changed. The preferred way to access this value is via thegetSourceProperty()method.- Overrides:
getSourcein classEventObject- Returns:
- the
Propertywhose state has changed.
-
getSourceProperty
Returns thePropertywhose state has changed.- Returns:
- the
Propertywhose state has changed.
-
getSourceObject
Returns the source object for which theProperty'sstate has changed.- Returns:
- the source object for which the
Property'sstate has changed
-
getValueChanged
public final boolean getValueChanged()Returns whether or not theProperty'svalue has changed for the source object.- Returns:
- whether or not the
Property'svalue has changed for the source object.
-
getOldValue
Returns the old value of thePropertyfor the source object, orUNREADABLEif thePropertywas not previously readable for the source object.Note: This method must only be called if
getValueChangedreturnstrue.- Returns:
- the old value of the
Propertyfor the source object orUNREADABLE - Throws:
UnsupportedOperationException- if the value hasn't changed
-
getNewValue
Returns the new value of thePropertyfor the source object, orUNREADABLEif thePropertyis not currently readable for the source object.Note: This method must only be called if
getValueChangedreturnstrue.- Returns:
- the new value of the
Propertyfor the source object orUNREADABLE - Throws:
UnsupportedOperationException- if the value hasn't changed
-
getReadableChanged
public final boolean getReadableChanged()Returns whether or not theProperty'sreadability has changed for the source object. In particuler, this returnstrueif the value has changed and either the old value or new value isUNREADABLE, andfalseotherwise.- Returns:
- whether or not the
Property'sreadability has changed for the source object.
-
isReadable
public final boolean isReadable()Returns whether or not thePropertyis currently readable for the source object. In particular, this returnstrueif and only if the new value is notUNREADABLE.Note: This method must only be called if
getReadableChangedreturnstrue.- Returns:
- whether or not the
Propertyis currently readable for the source object. - Throws:
UnsupportedOperationException- if the readability hasn't changed
-
getWriteableChanged
public final boolean getWriteableChanged()Returns whether or not theProperty'swriteability has changed for the source object.- Returns:
- whether or not the
Property'swriteability has changed for the source object.
-
isWriteable
public final boolean isWriteable()Returns whether or not thePropertyis currently writeable for the source object.Note: This method must only be called if
getWriteableChangedreturnstrue.- Returns:
- whether or not the
Propertyis currently writeable for the source object. - Throws:
UnsupportedOperationException- if the writeability hasn't changed
-
toString
Returns a string representation of thePropertyStateEvent. This method is intended to be used for debugging purposes only, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull.- Overrides:
toStringin classEventObject- Returns:
- a string representation of this
PropertyStateEvent
-