cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [33/50] cayenne-modeler git commit: Added some boilerplate helper methods.
Date Thu, 05 Jan 2017 22:09:41 GMT
Added some boilerplate helper 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/ed43c0ba
Tree: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/tree/ed43c0ba
Diff: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/diff/ed43c0ba

Branch: refs/heads/master
Commit: ed43c0ba3a6c7d4d0fef0e41c968d21c391b0fd7
Parents: 1067ef9
Author: mrg <blacknext@gmail.com>
Authored: Sun Oct 9 11:30:02 2016 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Sun Oct 9 11:30:02 2016 -0400

----------------------------------------------------------------------
 .../adapters/CayennePropertyAdapter.java        | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/ed43c0ba/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 0cff146..edbf6d2 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/CayennePropertyAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/CayennePropertyAdapter.java
@@ -19,7 +19,27 @@
 
 package org.apache.cayenne.modeler.adapters;
 
+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 abstract class CayennePropertyAdapter
 {
+    public static BooleanProperty bindBoolean(Object bean, String property) throws NoSuchMethodException
+    {
+        return JavaBeanBooleanPropertyBuilder.create().bean(bean).name(property).build();
+    }
+
+    public static IntegerProperty bindInteger(Object bean, String property) throws NoSuchMethodException
+    {
+        return JavaBeanIntegerPropertyBuilder.create().bean(bean).name(property).build();
+    }
 
+    public static StringProperty bindString(Object bean, String property) throws NoSuchMethodException
+    {
+        return JavaBeanStringPropertyBuilder.create().bean(bean).name(property).build();
+    }
 }


Mime
View raw message