cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [5/7] cayenne-modeler git commit: Added logging for all property changes.
Date Sat, 03 Jun 2017 11:36:43 GMT
Added logging for all property changes.


Project: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/commit/74696f30
Tree: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/tree/74696f30
Diff: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/diff/74696f30

Branch: refs/heads/master
Commit: 74696f30d6a0af517869b26212e6a0ebaad1eb46
Parents: 27318e5
Author: mrg <blacknext@gmail.com>
Authored: Sat Jun 3 07:34:27 2017 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Sat Jun 3 07:34:27 2017 -0400

----------------------------------------------------------------------
 .../cayenne/modeler/adapters/CayennePropertyAdapter.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/74696f30/src/main/java/org/apache/cayenne/modeler/adapters/CayennePropertyAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/CayennePropertyAdapter.java
b/src/main/java/org/apache/cayenne/modeler/adapters/CayennePropertyAdapter.java
index 018b13c..13a5ba0 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/CayennePropertyAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/CayennePropertyAdapter.java
@@ -29,6 +29,7 @@ import javafx.beans.property.Property;
 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 abstract class CayennePropertyAdapter
      */
     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;
     }


Mime
View raw message