Record Class PropertyFormFieldValueChangedEvent

java.lang.Object
java.lang.Record
ca.corbett.extras.properties.PropertyFormFieldValueChangedEvent

public record PropertyFormFieldValueChangedEvent(AbstractProperty property, ActionEvent sourceEvent, FormPanel formPanel, FormField formField) extends Record
Used by PropertyFormFieldChangeListener to indicate that a change has been made in a FormField that was created and is managed by some AbstractProperty instance. This class contains information about which FormField on which AbstractProperty was modified, and on which FormPanel the change happened.

IMPORTANT NOTE: Objects of this class contain both the AbstractProperty that generated the FormField, and also the FormField itself. Keep in mind that these change events are fired while the FormPanel in question is visible and has not yet been OK'd by the user! That means, the property in question has not yet been informed of the changes made in the form field. That means, if you wish to read the current version of the FormField, you should interrogate the FormField and NOT the AbstractProperty! If you want to know what the value of the field was at the time that it was generated by the AbstractProperty, then query the AbstractProperty, and not the FormField.

Since:
swing-extras 2.3
Author:
scorbo2
  • Constructor Details

    • PropertyFormFieldValueChangedEvent

      public PropertyFormFieldValueChangedEvent(AbstractProperty property, ActionEvent sourceEvent, FormPanel formPanel, FormField formField)
      Creates an instance of a PropertyFormFieldValueChangedEvent record class.
      Parameters:
      property - the value for the property record component
      sourceEvent - the value for the sourceEvent record component
      formPanel - the value for the formPanel record component
      formField - the value for the formField record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • property

      public AbstractProperty property()
      Returns the value of the property record component.
      Returns:
      the value of the property record component
    • sourceEvent

      public ActionEvent sourceEvent()
      Returns the value of the sourceEvent record component.
      Returns:
      the value of the sourceEvent record component
    • formPanel

      public FormPanel formPanel()
      Returns the value of the formPanel record component.
      Returns:
      the value of the formPanel record component
    • formField

      public FormField formField()
      Returns the value of the formField record component.
      Returns:
      the value of the formField record component