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 Object
Used 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 ofPropertyStateEvent
characterizing a change in aProperty's
state for a particular source object. -
Method Summary
Modifier and TypeMethodDescriptionfinal Object
Returns the new value of theProperty
for the source object, orUNREADABLE
if theProperty
is not currently readable for the source object.final Object
Returns the old value of theProperty
for the source object, orUNREADABLE
if theProperty
was not previously readable for the source object.final boolean
Returns whether or not theProperty's
readability has changed for the source object.final Object
Returns theProperty
whose state has changed.final Object
Returns the source object for which theProperty's
state has changed.final Property
Returns theProperty
whose state has changed.final boolean
Returns whether or not theProperty's
value has changed for the source object.final boolean
Returns whether or not theProperty's
writeability has changed for the source object.final boolean
Returns whether or not theProperty
is currently readable for the source object.final boolean
Returns whether or not theProperty
is 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 ofPropertyStateEvent
characterizing a change in aProperty's
state for a particular source object.Note: To indicate a change in readability, specify
valueChanged
astrue
and reflect the readability status in theoldValue
andnewValue
arguments.- Parameters:
sourceProperty
- theProperty
whose state has changedsourceObject
- the source object for which theProperty's
state has changedvalueChanged
- whether or not theProperty's
value has changed for the source objectoldValue
- the old value of theProperty
for the source object, orUNREADABLE
if theProperty
was not previously readable for the source objectnewValue
- the new value of theProperty
for the source object, orUNREADABLE
if theProperty
is not currently readable for the source objectwriteableChanged
- whether or not theProperty's
writeability has changed for the source objectisWriteable
- whether or not theProperty
is now writeable for the source object- Throws:
IllegalArgumentException
- if neither the value or the writeability has changedIllegalArgumentException
- ifvalueChanged
istrue
and botholdValue
andnewValue
areUNREADABLE
-
-
Method Details
-
getSource
Returns theProperty
whose state has changed. The preferred way to access this value is via thegetSourceProperty()
method.- Overrides:
getSource
in classEventObject
- Returns:
- the
Property
whose state has changed.
-
getSourceProperty
Returns theProperty
whose state has changed.- Returns:
- the
Property
whose state has changed.
-
getSourceObject
Returns the source object for which theProperty's
state has changed.- Returns:
- the source object for which the
Property's
state has changed
-
getValueChanged
public final boolean getValueChanged()Returns whether or not theProperty's
value has changed for the source object.- Returns:
- whether or not the
Property's
value has changed for the source object.
-
getOldValue
Returns the old value of theProperty
for the source object, orUNREADABLE
if theProperty
was not previously readable for the source object.Note: This method must only be called if
getValueChanged
returnstrue
.- Returns:
- the old value of the
Property
for the source object orUNREADABLE
- Throws:
UnsupportedOperationException
- if the value hasn't changed
-
getNewValue
Returns the new value of theProperty
for the source object, orUNREADABLE
if theProperty
is not currently readable for the source object.Note: This method must only be called if
getValueChanged
returnstrue
.- Returns:
- the new value of the
Property
for the source object orUNREADABLE
- Throws:
UnsupportedOperationException
- if the value hasn't changed
-
getReadableChanged
public final boolean getReadableChanged()Returns whether or not theProperty's
readability has changed for the source object. In particuler, this returnstrue
if the value has changed and either the old value or new value isUNREADABLE
, andfalse
otherwise.- Returns:
- whether or not the
Property's
readability has changed for the source object.
-
isReadable
public final boolean isReadable()Returns whether or not theProperty
is currently readable for the source object. In particular, this returnstrue
if and only if the new value is notUNREADABLE
.Note: This method must only be called if
getReadableChanged
returnstrue
.- Returns:
- whether or not the
Property
is currently readable for the source object. - Throws:
UnsupportedOperationException
- if the readability hasn't changed
-
getWriteableChanged
public final boolean getWriteableChanged()Returns whether or not theProperty's
writeability has changed for the source object.- Returns:
- whether or not the
Property's
writeability has changed for the source object.
-
isWriteable
public final boolean isWriteable()Returns whether or not theProperty
is currently writeable for the source object.Note: This method must only be called if
getWriteableChanged
returnstrue
.- Returns:
- whether or not the
Property
is 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:
toString
in classEventObject
- Returns:
- a string representation of this
PropertyStateEvent
-