Skip to content
Permalink
Browse files
Added logging for all property changes.
  • Loading branch information
mrg committed Jun 3, 2017
1 parent 27318e5 commit 74696f30d6a0af517869b26212e6a0ebaad1eb46
Showing 1 changed file with 9 additions and 1 deletion.
@@ -29,6 +29,7 @@
import javafx.beans.property.StringProperty;
import javafx.beans.property.adapter.JavaBeanBooleanPropertyBuilder;
import javafx.beans.property.adapter.JavaBeanIntegerPropertyBuilder;
import javafx.beans.property.adapter.JavaBeanProperty;
import javafx.beans.property.adapter.JavaBeanStringPropertyBuilder;

/**
@@ -101,7 +102,14 @@ public StringProperty bindString(String property) throws NoSuchMethodException
*/
private <T extends Property<?>> T observePropertyChanges(T property)
{
property.addListener((observable, newValue, oldValue) -> getCayennePropject().setDirty(true));
property.addListener((observable, oldValue, newValue) ->
{
JavaBeanProperty<?> changedProperty = (JavaBeanProperty<?>) observable;

getCayennePropject().setDirty(true);

LOGGER.debug("Property Changed: [" + changedProperty.getBean().getClass().getSimpleName() + " " + changedProperty.getName() + "] " + oldValue + " -> " + newValue);
});

return property;
}

0 comments on commit 74696f3

Please sign in to comment.