cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [34/50] cayenne-modeler git commit: Added Use Remote Change Notification to Data Domain.
Date Thu, 05 Jan 2017 22:09:42 GMT
Added Use Remote Change Notification to 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/95729e86
Tree: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/tree/95729e86
Diff: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/diff/95729e86

Branch: refs/heads/master
Commit: 95729e86777e7d817345f3aa7bf712551f23b7e1
Parents: ed43c0b
Author: mrg <blacknext@gmail.com>
Authored: Sun Oct 9 11:32:04 2016 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Sun Oct 9 11:32:04 2016 -0400

----------------------------------------------------------------------
 .../modeler/adapters/DataDomainAdapter.java     | 25 +++++++++++---------
 .../modeler/layout/DataDomainLayout.java        |  6 ++++-
 .../cayenne/modeler/project/CayenneProject.java | 10 ++++++++
 3 files changed, 29 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/95729e86/src/main/java/org/apache/cayenne/modeler/adapters/DataDomainAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/DataDomainAdapter.java b/src/main/java/org/apache/cayenne/modeler/adapters/DataDomainAdapter.java
index c169968..e83efeb 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/DataDomainAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/DataDomainAdapter.java
@@ -27,16 +27,14 @@ import org.apache.cayenne.modeler.project.CayenneProject;
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.IntegerProperty;
 import javafx.beans.property.StringProperty;
-import javafx.beans.property.adapter.JavaBeanBooleanPropertyBuilder;
-import javafx.beans.property.adapter.JavaBeanIntegerPropertyBuilder;
-import javafx.beans.property.adapter.JavaBeanStringPropertyBuilder;
 
 public class DataDomainAdapter extends CayennePropertyAdapter // implements AdapterSupport<CayenneProject>
 {
-    private static final String DATA_DOMAIN_NAME   = "dataDomainName";
-    private static final String VALIDATING_OBJECTS = "dataDomainValidatingObjects";
-    private static final String OBJECT_CACHE_SIZE  = "sizeOfObjectCache";
-    private static final String USE_SHARED_CACHE   = "usingSharedCache";
+    private static final String DATA_DOMAIN_NAME            = "dataDomainName";
+    private static final String VALIDATING_OBJECTS          = "dataDomainValidatingObjects";
+    private static final String OBJECT_CACHE_SIZE           = "sizeOfObjectCache";
+    private static final String USE_SHARED_CACHE            = "usingSharedCache";
+    private static final String REMOTE_CHANGE_NOTIFICATIONS = "remoteChangeNotificationsEnabled";
 
     private final CayenneProject cayenneProject;
 
@@ -59,10 +57,11 @@ public class DataDomainAdapter extends CayennePropertyAdapter // implements
Adap
 
         try
         {
-            nameProperty              = JavaBeanStringPropertyBuilder.create().bean(cayenneProject).name(DATA_DOMAIN_NAME).build();
-            validatingObjectsProperty = JavaBeanBooleanPropertyBuilder.create().bean(cayenneProject).name(VALIDATING_OBJECTS).build();
-            sizeOfObjectCacheProperty = JavaBeanIntegerPropertyBuilder.create().bean(cayenneProject).name(OBJECT_CACHE_SIZE).build();
-            useSharedCacheProperty    = JavaBeanBooleanPropertyBuilder.create().bean(cayenneProject).name(USE_SHARED_CACHE).build();
+            nameProperty                      = bindString(cayenneProject, DATA_DOMAIN_NAME);
+            validatingObjectsProperty         = bindBoolean(cayenneProject, VALIDATING_OBJECTS);
+            sizeOfObjectCacheProperty         = bindInteger(cayenneProject, OBJECT_CACHE_SIZE);
+            useSharedCacheProperty            = bindBoolean(cayenneProject, USE_SHARED_CACHE);
+            remoteChangeNotificationsProperty = bindBoolean(cayenneProject, REMOTE_CHANGE_NOTIFICATIONS);
         }
         catch (final NoSuchMethodException e)
         {
@@ -86,6 +85,10 @@ public class DataDomainAdapter extends CayennePropertyAdapter // implements
Adap
     public Boolean getUseSharedCache() { return useSharedCacheProperty.get(); }
     public void setUseSharedCache(final Boolean value) { useSharedCacheProperty.set(value);
}
 
+    public BooleanProperty remoteChangeNotificationsProperty() { return remoteChangeNotificationsProperty;
}
+    public Boolean getRemoteChangeNotifications() { return remoteChangeNotificationsProperty.get();
}
+    public void setRemoteChangeNotifications(final Boolean value) { remoteChangeNotificationsProperty.set(value);
}
+
     public List<DataMapAdapter> getDataMapAdapters()
     {
         return dataMapAdapters;

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/95729e86/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 ff8a021..e2211f3 100644
--- a/src/main/java/org/apache/cayenne/modeler/layout/DataDomainLayout.java
+++ b/src/main/java/org/apache/cayenne/modeler/layout/DataDomainLayout.java
@@ -95,9 +95,11 @@ public class DataDomainLayout
 
         objectCacheSizeSpinner.getValueFactory().valueProperty().bindBidirectional(dataDomainAdapter.sizeOfObjectCacheProperty().asObject());
         useSharedCacheCheckBox.selectedProperty().bindBidirectional(dataDomainAdapter.useSharedCacheProperty());
+        remoteChangeNotificationsCheckBox.selectedProperty().bindBidirectional(dataDomainAdapter.remoteChangeNotificationsProperty());
     }
 
-    public void beginEditingNotCalled()
+    @Deprecated
+    private void beginEditingNotCalled()
     {
         LOGGER.debug("begin editing");
 
@@ -150,6 +152,8 @@ public class DataDomainLayout
         objectValidationCheckBox.selectedProperty().unbindBidirectional(dataDomainAdapter.validatingObjectsProperty());
 
         objectCacheSizeSpinner.getValueFactory().valueProperty().unbindBidirectional(dataDomainAdapter.sizeOfObjectCacheProperty().asObject());
+        useSharedCacheCheckBox.selectedProperty().unbindBidirectional(dataDomainAdapter.useSharedCacheProperty());
+        remoteChangeNotificationsCheckBox.selectedProperty().unbindBidirectional(dataDomainAdapter.remoteChangeNotificationsProperty());
 
 //        NotificationCenter.removeProjectListener(getMainWindow().getCayenneProject(), this);
 ////        BeanPathAdapter<CayenneModel> dataDomainAdapter = getDataDomainPropertyAdapterMap(getMainWindow().getCayenneModel());

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/95729e86/src/main/java/org/apache/cayenne/modeler/project/CayenneProject.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/project/CayenneProject.java b/src/main/java/org/apache/cayenne/modeler/project/CayenneProject.java
index e5a31ba..881b713 100644
--- a/src/main/java/org/apache/cayenne/modeler/project/CayenneProject.java
+++ b/src/main/java/org/apache/cayenne/modeler/project/CayenneProject.java
@@ -164,6 +164,16 @@ public class CayenneProject
         setDomainBooleanProperty(DataDomain.SHARED_CACHE_ENABLED_PROPERTY, usingSharedCache,
DataDomain.SHARED_CACHE_ENABLED_DEFAULT);
     }
 
+    public boolean isRemoteChangeNotificationsEnabled()
+    {
+        return getDomainBooleanProperty(DataRowStore.REMOTE_NOTIFICATION_PROPERTY, DataRowStore.REMOTE_NOTIFICATION_DEFAULT);
+    }
+
+    public void setRemoteChangeNotificationsEnabled(final boolean remoteChangeNotificationsEnabled)
+    {
+        setDomainBooleanProperty(DataRowStore.REMOTE_NOTIFICATION_PROPERTY, remoteChangeNotificationsEnabled,
DataRowStore.REMOTE_NOTIFICATION_DEFAULT);
+    }
+
     public Collection<DataMap> getDataMaps()
     {
         return root.getDataMaps();


Mime
View raw message