cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [35/50] cayenne-modeler git commit: Switched adapters to using convenience binding methods.
Date Thu, 05 Jan 2017 22:09:43 GMT
Switched adapters to using convenience binding methods.


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

Branch: refs/heads/master
Commit: cacc34edd5551a181803dcc239d988ee9325cd44
Parents: 95729e8
Author: mrg <blacknext@gmail.com>
Authored: Sun Oct 9 11:52:23 2016 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Sun Oct 9 11:52:23 2016 -0400

----------------------------------------------------------------------
 .../modeler/adapters/DataMapAdapter.java        | 23 +++++++++-----------
 .../modeler/adapters/DataNodeAdapter.java       |  3 +--
 .../modeler/adapters/DatabaseEntityAdapter.java |  5 +----
 .../adapters/ObjectAttributeAdapter.java        | 10 ++++-----
 .../modeler/adapters/ObjectEntityAdapter.java   |  6 ++---
 5 files changed, 18 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/cacc34ed/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java b/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
index b86e5d8..dc9d8d9 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
@@ -27,9 +27,6 @@ import org.apache.commons.lang3.ObjectUtils;
 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;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 
@@ -63,22 +60,22 @@ public class DataMapAdapter extends CayennePropertyAdapter // implements
Adapter
 
         try
         {
-            nameProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name("name").build();
+            nameProperty = bindString(dataMap, "name");
 //            locationProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name("map").build();
 
             // TODO: Fix Cayenne?  The DEFAULT_QUOTE_SQL_IDENTIFIERS_PROPERTY constant is
incorrect.
-            quoteSQLIdentifiersProperty = JavaBeanBooleanPropertyBuilder.create().bean(dataMap).name("quotingSQLIdentifiers").build();
+            quoteSQLIdentifiersProperty = bindBoolean(dataMap, "quotingSQLIdentifiers");
 
-            defaultCatalogProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_CATALOG_PROPERTY).build();
-            defaultSchemaProperty  = JavaBeanStringPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_SCHEMA_PROPERTY).build();
-            defaultPackageProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_PACKAGE_PROPERTY).build();
+            defaultCatalogProperty = bindString(dataMap, DataMap.DEFAULT_CATALOG_PROPERTY);
+            defaultSchemaProperty  = bindString(dataMap, DataMap.DEFAULT_SCHEMA_PROPERTY);
+            defaultPackageProperty = bindString(dataMap, DataMap.DEFAULT_PACKAGE_PROPERTY);
 
-            defaultSuperclassProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_SUPERCLASS_PROPERTY).build();
-            defaultLockTypeProperty   = JavaBeanIntegerPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_LOCK_TYPE_PROPERTY).build();
+            defaultSuperclassProperty = bindString(dataMap, DataMap.DEFAULT_SUPERCLASS_PROPERTY);
+            defaultLockTypeProperty   = bindInteger(dataMap, DataMap.DEFAULT_LOCK_TYPE_PROPERTY);
 
-            clientSupportedProperty         = JavaBeanBooleanPropertyBuilder.create().bean(dataMap).name(DataMap.CLIENT_SUPPORTED_PROPERTY).build();
-            defaultClientPackageProperty    = JavaBeanStringPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_CLIENT_PACKAGE_PROPERTY).build();
-            defaultClientSuperclassProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_CLIENT_SUPERCLASS_PROPERTY).build();
+            clientSupportedProperty         = bindBoolean(dataMap, DataMap.CLIENT_SUPPORTED_PROPERTY);
+            defaultClientPackageProperty    = bindString(dataMap, DataMap.DEFAULT_CLIENT_PACKAGE_PROPERTY);
+            defaultClientSuperclassProperty = bindString(dataMap, DataMap.DEFAULT_CLIENT_SUPERCLASS_PROPERTY);
         }
         catch (final NoSuchMethodException e)
         {

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/cacc34ed/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java b/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java
index 29722ca..7a667f6 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java
@@ -22,7 +22,6 @@ package org.apache.cayenne.modeler.adapters;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
 
 import javafx.beans.property.StringProperty;
-import javafx.beans.property.adapter.JavaBeanStringPropertyBuilder;
 
 public class DataNodeAdapter extends CayennePropertyAdapter
 {
@@ -40,7 +39,7 @@ public class DataNodeAdapter extends CayennePropertyAdapter
 
         try
         {
-            nameProperty                 = JavaBeanStringPropertyBuilder.create().bean(dataNode).name("name").build();
+            nameProperty                 = bindString(dataNode, "name");
 //            dataSourceLocationProperty       = JavaBeanStringPropertyBuilder.create().bean(dataNode).name("dataSourceLocation").build();
 //            dataSourceFactoryProperty        = JavaBeanStringPropertyBuilder.create().bean(dataNode).name("dataSourceFactory").build();
 //            schemaUpdateStrategyNameProperty = JavaBeanStringPropertyBuilder.create().bean(dataNode).name("schemaUpdateStrategyName").build();

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/cacc34ed/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
b/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
index 3eaa5f7..bc1fbad 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
@@ -27,7 +27,6 @@ import org.apache.cayenne.map.DbEntity;
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.IntegerProperty;
 import javafx.beans.property.StringProperty;
-import javafx.beans.property.adapter.JavaBeanStringPropertyBuilder;
 
 public class DatabaseEntityAdapter extends CayennePropertyAdapter // implements AdapterSupport<DataMap>
 {
@@ -59,14 +58,12 @@ public class DatabaseEntityAdapter extends CayennePropertyAdapter // implements
 
         try
         {
-            nameProperty = JavaBeanStringPropertyBuilder.create().bean(databaseEntity).name("name").build();
+            nameProperty = bindString(databaseEntity, "name");
         }
         catch (final NoSuchMethodException e)
         {
             throw new RuntimeException("Fix the builder.", e);
         }
-
-//        this.dataMapAdapter = new BeanPathAdapter<DataMap>(dataMap);
     }
 
     public StringProperty nameProperty() { return nameProperty; }

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/cacc34ed/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
index 18d58d7..d2b756e 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
@@ -24,8 +24,6 @@ import org.apache.cayenne.map.ObjAttribute;
 
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.StringProperty;
-import javafx.beans.property.adapter.JavaBeanBooleanPropertyBuilder;
-import javafx.beans.property.adapter.JavaBeanStringPropertyBuilder;
 
 public class ObjectAttributeAdapter extends CayennePropertyAdapter // implements AdapterSupport<DataMap>
 {
@@ -57,10 +55,10 @@ public class ObjectAttributeAdapter extends CayennePropertyAdapter //
implements
 
         try
         {
-            nameProperty = JavaBeanStringPropertyBuilder.create().bean(objectAttribute).name("name").build();
-            javaTypeProperty = JavaBeanStringPropertyBuilder.create().bean(objectAttribute).name("type").build();
-            databaseAttributePathProperty = JavaBeanStringPropertyBuilder.create().bean(objectAttribute).name("dbAttributePath").build();
-            usedForLockingProperty = JavaBeanBooleanPropertyBuilder.create().bean(objectAttribute).name("usedForLocking").build();
+            nameProperty                  = bindString(objectAttribute, "name");
+            javaTypeProperty              = bindString(objectAttribute, "type");
+            databaseAttributePathProperty = bindString(objectAttribute, "dbAttributePath");
+            usedForLockingProperty        = bindBoolean(objectAttribute, "usedForLocking");
 
 
 //            locationProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name("map").build();

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/cacc34ed/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
index 4ffa5b2..f8bd74a 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
@@ -23,8 +23,6 @@ import org.apache.cayenne.map.ObjEntity;
 
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.StringProperty;
-import javafx.beans.property.adapter.JavaBeanBooleanPropertyBuilder;
-import javafx.beans.property.adapter.JavaBeanStringPropertyBuilder;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 
@@ -58,8 +56,8 @@ public class ObjectEntityAdapter extends CayennePropertyAdapter // implements
Ad
 
         try
         {
-            nameProperty = JavaBeanStringPropertyBuilder.create().bean(objectEntity).name("name").build();
-            abstractClassProperty = JavaBeanBooleanPropertyBuilder.create().bean(objectEntity).name("abstract").build();
+            nameProperty          = bindString(objectEntity, "name");
+            abstractClassProperty = bindBoolean(objectEntity, "abstract");
 
 
 //            locationProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name("map").build();


Mime
View raw message