Class PropertyStateEvent

java.lang.Object
java.util.EventObject
org.jdesktop.beansbinding.PropertyStateEvent
All Implemented Interfaces:
Serializable

public class PropertyStateEvent extends EventObject
An event characterizing a change in a Property's state for a particular source object.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Object
    Used to indicate that a particular value is unreadable.

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    PropertyStateEvent(Property sourceProperty, Object sourceObject, boolean valueChanged, Object oldValue, Object newValue, boolean writeableChanged, boolean isWriteable)
    Creates an instance of PropertyStateEvent characterizing a change in a Property's state for a particular source object.
  • Method Summary

    Modifier and Type
    Method
    Description
    final Object
    Returns the new value of the Property for the source object, or UNREADABLE if the Property is not currently readable for the source object.
    final Object
    Returns the old value of the Property for the source object, or UNREADABLE if the Property was not previously readable for the source object.
    final boolean
    Returns whether or not the Property's readability has changed for the source object.
    final Object
    Returns the Property whose state has changed.
    final Object
    Returns the source object for which the Property's state has changed.
    final Property
    Returns the Property whose state has changed.
    final boolean
    Returns whether or not the Property's value has changed for the source object.
    final boolean
    Returns whether or not the Property's writeability has changed for the source object.
    final boolean
    Returns whether or not the Property is currently readable for the source object.
    final boolean
    Returns whether or not the Property is currently writeable for the source object.
    Returns a string representation of the PropertyStateEvent.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • UNREADABLE

      public static final Object 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 of PropertyStateEvent characterizing a change in a Property's state for a particular source object.

      Note: To indicate a change in readability, specify valueChanged as true and reflect the readability status in the oldValue and newValue arguments.

      Parameters:
      sourceProperty - the Property whose state has changed
      sourceObject - the source object for which the Property's state has changed
      valueChanged - whether or not the Property's value has changed for the source object
      oldValue - the old value of the Property for the source object, or UNREADABLE if the Property was not previously readable for the source object
      newValue - the new value of the Property for the source object, or UNREADABLE if the Property is not currently readable for the source object
      writeableChanged - whether or not the Property's writeability has changed for the source object
      isWriteable - whether or not the Property is now writeable for the source object
      Throws:
      IllegalArgumentException - if neither the value or the writeability has changed
      IllegalArgumentException - if valueChanged is true and both oldValue and newValue are UNREADABLE
  • Method Details

    • getSource

      public final Object getSource()
      Returns the Property whose state has changed. The preferred way to access this value is via the getSourceProperty() method.
      Overrides:
      getSource in class EventObject
      Returns:
      the Property whose state has changed.
    • getSourceProperty

      public final Property getSourceProperty()
      Returns the Property whose state has changed.
      Returns:
      the Property whose state has changed.
    • getSourceObject

      public final Object getSourceObject()
      Returns the source object for which the Property'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 the Property'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 Object getOldValue()
      Returns the old value of the Property for the source object, or UNREADABLE if the Property was not previously readable for the source object.

      Note: This method must only be called if getValueChanged returns true.

      Returns:
      the old value of the Property for the source object or UNREADABLE
      Throws:
      UnsupportedOperationException - if the value hasn't changed
    • getNewValue

      public final Object getNewValue()
      Returns the new value of the Property for the source object, or UNREADABLE if the Property is not currently readable for the source object.

      Note: This method must only be called if getValueChanged returns true.

      Returns:
      the new value of the Property for the source object or UNREADABLE
      Throws:
      UnsupportedOperationException - if the value hasn't changed
    • getReadableChanged

      public final boolean getReadableChanged()
      Returns whether or not the Property's readability has changed for the source object. In particuler, this returns true if the value has changed and either the old value or new value is UNREADABLE, and false otherwise.
      Returns:
      whether or not the Property's readability has changed for the source object.
    • isReadable

      public final boolean isReadable()
      Returns whether or not the Property is currently readable for the source object. In particular, this returns true if and only if the new value is not UNREADABLE.

      Note: This method must only be called if getReadableChanged returns true.

      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 the Property'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 the Property is currently writeable for the source object.

      Note: This method must only be called if getWriteableChanged returns true.

      Returns:
      whether or not the Property is currently writeable for the source object.
      Throws:
      UnsupportedOperationException - if the writeability hasn't changed
    • toString

      public String toString()
      Returns a string representation of the PropertyStateEvent. 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 be null.
      Overrides:
      toString in class EventObject
      Returns:
      a string representation of this PropertyStateEvent