Package org.jdesktop.beansbinding
Class PropertyStateEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.jdesktop.beansbinding.PropertyStateEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class PropertyStateEvent extends java.util.EventObject
An event characterizing a change in aProperty's
state for a particular source object.- See Also:
Property
,PropertyStateListener
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Object
UNREADABLE
Used to indicate that a particular value is unreadable.
-
Constructor Summary
Constructors Constructor Description PropertyStateEvent(Property sourceProperty, java.lang.Object sourceObject, boolean valueChanged, java.lang.Object oldValue, java.lang.Object newValue, boolean writeableChanged, boolean isWriteable)
Creates an instance ofPropertyStateEvent
characterizing a change in aProperty's
state for a particular source object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getNewValue()
Returns the new value of theProperty
for the source object, orUNREADABLE
if theProperty
is not currently readable for the source object.java.lang.Object
getOldValue()
Returns the old value of theProperty
for the source object, orUNREADABLE
if theProperty
was not previously readable for the source object.boolean
getReadableChanged()
Returns whether or not theProperty's
readability has changed for the source object.java.lang.Object
getSource()
Returns theProperty
whose state has changed.java.lang.Object
getSourceObject()
Returns the source object for which theProperty's
state has changed.Property
getSourceProperty()
Returns theProperty
whose state has changed.boolean
getValueChanged()
Returns whether or not theProperty's
value has changed for the source object.boolean
getWriteableChanged()
Returns whether or not theProperty's
writeability has changed for the source object.boolean
isReadable()
Returns whether or not theProperty
is currently readable for the source object.boolean
isWriteable()
Returns whether or not theProperty
is currently writeable for the source object.java.lang.String
toString()
Returns a string representation of thePropertyStateEvent
.
-
-
-
Constructor Detail
-
PropertyStateEvent
public PropertyStateEvent(Property sourceProperty, java.lang.Object sourceObject, boolean valueChanged, java.lang.Object oldValue, java.lang.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:
java.lang.IllegalArgumentException
- if neither the value or the writeability has changedjava.lang.IllegalArgumentException
- ifvalueChanged
istrue
and botholdValue
andnewValue
areUNREADABLE
-
-
Method Detail
-
getSource
public final java.lang.Object getSource()
Returns theProperty
whose state has changed. The preferred way to access this value is via thegetSourceProperty()
method.- Overrides:
getSource
in classjava.util.EventObject
- Returns:
- the
Property
whose state has changed.
-
getSourceProperty
public final Property getSourceProperty()
Returns theProperty
whose state has changed.- Returns:
- the
Property
whose state has changed.
-
getSourceObject
public final java.lang.Object 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
public final java.lang.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:
java.lang.UnsupportedOperationException
- if the value hasn't changed
-
getNewValue
public final java.lang.Object 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:
java.lang.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:
java.lang.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:
java.lang.UnsupportedOperationException
- if the writeability hasn't changed
-
toString
public java.lang.String 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 classjava.util.EventObject
- Returns:
- a string representation of this
PropertyStateEvent
-
-