cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [7/7] cayenne-modeler git commit: First attempt at using generic bind/unbind mechanism.
Date Sat, 03 Jun 2017 11:36:45 GMT
First attempt at using generic bind/unbind mechanism.


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

Branch: refs/heads/master
Commit: 1edef7d5350357be88178022262994f7f127d3cc
Parents: 4861004
Author: mrg <blacknext@gmail.com>
Authored: Sat Jun 3 07:36:29 2017 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Sat Jun 3 07:36:29 2017 -0400

----------------------------------------------------------------------
 .../cayenne/modeler/layout/DataMapLayout.java   | 39 +++++++++++++++-----
 1 file changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/1edef7d5/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java b/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java
index 1fc8ad5..cb8d9e6 100644
--- a/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java
+++ b/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java
@@ -20,6 +20,8 @@
 package org.apache.cayenne.modeler.layout;
 
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.cayenne.modeler.adapters.DataMapAdapter;
 import org.apache.commons.logging.Log;
@@ -45,6 +47,8 @@ public class DataMapLayout
 
     private DataMapAdapter dataMapAdapter;
 
+    private List<Binding<?>> bindings;
+
     public DataMapLayout(final MainWindowSupport parentComponent) throws IOException
     {
         super(parentComponent, "/layouts/DataMapLayout.fxml");
@@ -57,20 +61,37 @@ public class DataMapLayout
     }
 
     @Override
-    public void beginEditing()
+    public void initializeBindings()
     {
-        LOGGER.debug("begin editing " + this);
+        bindings = new ArrayList<>();
 
-        dataMapNameTextField.textProperty().bindBidirectional(dataMapAdapter.nameProperty());
-        quoteSqlIdentifiersCheckBox.selectedProperty().bindBidirectional(dataMapAdapter.quoteSQLIdentifiersProperty());
+        bindings.add(new Binding<>(dataMapNameTextField.textProperty(), dataMapAdapter.nameProperty()));
+        bindings.add(new Binding<>(quoteSqlIdentifiersCheckBox.selectedProperty(),
dataMapAdapter.quoteSQLIdentifiersProperty()));
     }
 
     @Override
-    public void endEditing()
+    public List<Binding<?>> getBindings()
     {
-        LOGGER.debug("end editing " + this);
-
-        dataMapNameTextField.textProperty().unbindBidirectional(dataMapAdapter.nameProperty());
-        quoteSqlIdentifiersCheckBox.selectedProperty().unbindBidirectional(dataMapAdapter.quoteSQLIdentifiersProperty());
+        return bindings;
     }
+
+//    @Override
+//    public void beginEditing()
+//    {
+//        LOGGER.debug("begin editing " + this);
+//
+//        DetailEditorSupport.super.beginEditing();
+////        dataMapNameTextField.textProperty().bindBidirectional(dataMapAdapter.nameProperty());
+////        quoteSqlIdentifiersCheckBox.selectedProperty().bindBidirectional(dataMapAdapter.quoteSQLIdentifiersProperty());
+//    }
+//
+//    @Override
+//    public void endEditing()
+//    {
+//        LOGGER.debug("end editing " + this);
+//
+//        DetailEditorSupport.super.endEditing();
+////        dataMapNameTextField.textProperty().unbindBidirectional(dataMapAdapter.nameProperty());
+////        quoteSqlIdentifiersCheckBox.selectedProperty().unbindBidirectional(dataMapAdapter.quoteSQLIdentifiersProperty());
+//    }
 }


Mime
View raw message