public class UpdateLastChangedPropertyChangeListener extends Object implements PropertyChangeListener
PropertyChangeListener
which a updates a "Property with type Date" with "new Date()
" whenever another Property is changed. Constructor and Description |
---|
UpdateLastChangedPropertyChangeListener(Property<Date> dateProperty)
Constructor where you provide the Property that will automatically be updated.
|
Modifier and Type | Method and Description |
---|---|
void |
changeFailed(Property<?> property,
String currentValue,
String failedValue,
PropertyException exception)
This method is called if setting an Property failed with a PropertyException.
The method is only called by the Property.setTypedValue() method. |
void |
changeSuccessfull(Property<?> property,
String beforeValue,
String afterValue)
Will set the DateProperty to "new Date()".
|
Property<Date> |
getDateProperty()
Gets the Property that holds the date.
|
public Property<Date> getDateProperty()
public void changeSuccessfull(Property<?> property, String beforeValue, String afterValue)
changeSuccessfull
in interface PropertyChangeListener
property
- the property that has been changed.beforeValue
- the value the property had before it was changed as a String.afterValue
- the value the property had after it was changed as a String.public void changeFailed(Property<?> property, String currentValue, String failedValue, PropertyException exception)
PropertyChangeListener
changeFailed
in interface PropertyChangeListener
property
- the property that was intended to be changed.currentValue
- the value the property is now.failedValue
- the value the property was intented to be changed to.exception
- the exception that was thrown.