cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [37/50] cayenne-modeler git commit: Added automatic enable/disable for Remote Change Notifications controls in Data Domain.
Date Thu, 05 Jan 2017 22:09:45 GMT
Added automatic enable/disable for Remote Change Notifications controls in Data Domain.


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

Branch: refs/heads/master
Commit: 8db0ac305aa185cfcb9ebeb6d794c43713c9b7a9
Parents: fc890ce
Author: mrg <blacknext@gmail.com>
Authored: Sun Oct 9 13:12:11 2016 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Sun Oct 9 13:12:11 2016 -0400

----------------------------------------------------------------------
 .../modeler/layout/DataDomainLayout.java        | 26 ++++++++++++++++++++
 .../resources/layouts/DataDomainLayout.fxml     |  2 +-
 2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/8db0ac30/src/main/java/org/apache/cayenne/modeler/layout/DataDomainLayout.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/layout/DataDomainLayout.java b/src/main/java/org/apache/cayenne/modeler/layout/DataDomainLayout.java
index e2211f3..6a2f28c 100644
--- a/src/main/java/org/apache/cayenne/modeler/layout/DataDomainLayout.java
+++ b/src/main/java/org/apache/cayenne/modeler/layout/DataDomainLayout.java
@@ -30,6 +30,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javafx.fxml.FXML;
+import javafx.scene.control.Button;
 import javafx.scene.control.CheckBox;
 import javafx.scene.control.Spinner;
 import javafx.scene.control.SpinnerValueFactory;
@@ -59,6 +60,9 @@ public class DataDomainLayout
     @FXML
     private CheckBox useSharedCacheCheckBox, remoteChangeNotificationsCheckBox;
 
+    @FXML
+    private Button remoteChangeConfigurationButton;
+
     private DataDomainAdapter dataDomainAdapter;
 
     public DataDomainLayout(final MainWindowSupport parentComponent) throws IOException
@@ -77,6 +81,11 @@ public class DataDomainLayout
         super.initializeLayout();
 
         objectCacheSizeSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0,
Integer.MAX_VALUE, DataRowStore.SNAPSHOT_CACHE_SIZE_DEFAULT, 100));
+
+        useSharedCacheCheckBox.selectedProperty().addListener((obs, oldValue, newValue) ->
+        {
+            configureRemoteNotifications(newValue);
+        });
     }
 
     @Override
@@ -96,6 +105,8 @@ public class DataDomainLayout
         objectCacheSizeSpinner.getValueFactory().valueProperty().bindBidirectional(dataDomainAdapter.sizeOfObjectCacheProperty().asObject());
         useSharedCacheCheckBox.selectedProperty().bindBidirectional(dataDomainAdapter.useSharedCacheProperty());
         remoteChangeNotificationsCheckBox.selectedProperty().bindBidirectional(dataDomainAdapter.remoteChangeNotificationsProperty());
+
+        configureRemoteNotifications(dataDomainAdapter.getUseSharedCache());
     }
 
     @Deprecated
@@ -200,4 +211,19 @@ public class DataDomainLayout
         }
         // TODO Auto-generated method stub
     }
+
+    private void configureRemoteNotifications(boolean enabled)
+    {
+        if (enabled)
+        {
+            enable(remoteChangeNotificationsCheckBox);
+            enable(remoteChangeConfigurationButton);
+        }
+        else
+        {
+            disable(remoteChangeNotificationsCheckBox);
+            disable(remoteChangeConfigurationButton);
+            dataDomainAdapter.setRemoteChangeNotifications(false);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/8db0ac30/src/main/resources/layouts/DataDomainLayout.fxml
----------------------------------------------------------------------
diff --git a/src/main/resources/layouts/DataDomainLayout.fxml b/src/main/resources/layouts/DataDomainLayout.fxml
index 04e63bc..b2df3f0 100644
--- a/src/main/resources/layouts/DataDomainLayout.fxml
+++ b/src/main/resources/layouts/DataDomainLayout.fxml
@@ -77,7 +77,7 @@
                      <children>
                         <CheckBox fx:id="remoteChangeNotificationsCheckBox" mnemonicParsing="false"
text="Remote Change Notifications" />
                         <Pane prefWidth="30.0" />
-                        <Button mnemonicParsing="false" text="Configure..." />
+                        <Button fx:id="remoteChangeConfigurationButton" mnemonicParsing="false"
text="Configure..." />
                      </children>
                   </HBox>
                </children>


Mime
View raw message