cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [06/50] cayenne-modeler git commit: Added ObjectEntityAttributeAdapter, plus partially working Object Entity Attributes and started implementing more proper Property Adapters.
Date Thu, 05 Jan 2017 22:09:14 GMT
Added ObjectEntityAttributeAdapter, plus partially working Object Entity Attributes and started
implementing more proper Property Adapters.


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

Branch: refs/heads/master
Commit: 432e8bfed7f3969f9a925b8eaa0b1bbc2840ccf6
Parents: 980a2c0
Author: mrg <blacknext@gmail.com>
Authored: Mon Sep 26 06:35:30 2016 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Mon Sep 26 06:35:30 2016 -0400

----------------------------------------------------------------------
 .../modeler/adapters/DataMapAdapter.java        |  40 +++++--
 .../adapters/ObjectAttributeAdapter.java        | 116 +++++++++++++++++++
 .../modeler/adapters/ObjectEntityAdapter.java   |  14 ++-
 .../layout/ObjectEntityAttributesTabLayout.java | 107 ++++++++++++++---
 .../ObjectEntityAttributesTabLayout.fxml        |  13 +--
 .../layouts/ObjectEntityClassTabLayout.fxml     |  13 ++-
 6 files changed, 263 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/432e8bfe/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 368f62a..02910f8 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
@@ -19,12 +19,12 @@
 
 package org.apache.cayenne.modeler.adapters;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.ObjEntity;
+import org.apache.commons.lang3.ObjectUtils;
 
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.IntegerProperty;
@@ -32,14 +32,18 @@ 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;
 
 public class DataMapAdapter extends CayennePropertyAdapter // implements AdapterSupport<DataMap>
 {
     private final DataMap dataMap;
 //    private BeanPathAdapter<DataMap> dataMapAdapter;
 
-    private final List<ObjectEntityAdapter>   objectEntityAdapters   = new ArrayList<>();
-    private final List<DatabaseEntityAdapter> databaseEntityAdapters = new ArrayList<>();
+//    private final List<ObjectEntityAdapter>   objectEntityAdapters   = new ArrayList<>();
+//    private final List<DatabaseEntityAdapter> databaseEntityAdapters = new ArrayList<>();
+    private final ObservableList<ObjectEntityAdapter>   objectEntityAdapters   = FXCollections.observableArrayList();
+    private final ObservableList<DatabaseEntityAdapter> databaseEntityAdapters = FXCollections.observableArrayList();
 
     private StringProperty nameProperty;
 
@@ -62,12 +66,6 @@ public class DataMapAdapter extends CayennePropertyAdapter // implements
Adapter
     {
         this.dataMap = dataMap;
 
-        for (ObjEntity objEntity : dataMap.getObjEntities())
-            objectEntityAdapters.add(new ObjectEntityAdapter(objEntity));
-
-        for (DbEntity dbEntity : dataMap.getDbEntities())
-            databaseEntityAdapters.add(new DatabaseEntityAdapter(dbEntity));
-
         try
         {
             nameProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name("name").build();
@@ -92,6 +90,22 @@ public class DataMapAdapter extends CayennePropertyAdapter // implements
Adapter
             throw new RuntimeException("Fix the builder.", e);
         }
 
+        // Create ObjectEntityAdapters for all object entities.
+        for (final ObjEntity objEntity : dataMap.getObjEntities())
+            objectEntityAdapters.add(new ObjectEntityAdapter(objEntity));
+
+        // Sort the ObjectEntityAdapters (by their name).
+        sortObjectEntities();
+
+        // Add change listeners for all ObjectEntityAdapter name changes and automatically
re-sort.
+        for (final ObjectEntityAdapter objectEntityAdapter : objectEntityAdapters)
+            objectEntityAdapter.getNameProperty().addListener((observable, oldValue, newValue)
-> sortObjectEntities());
+
+        // Create DatabaseEntityAdapters for all database entities.
+        for (final DbEntity dbEntity : dataMap.getDbEntities())
+            databaseEntityAdapters.add(new DatabaseEntityAdapter(dbEntity));
+
+
 //        this.dataMapAdapter = new BeanPathAdapter<DataMap>(dataMap);
     }
 
@@ -159,4 +173,12 @@ public class DataMapAdapter extends CayennePropertyAdapter // implements
Adapter
     {
         return databaseEntityAdapters;
     }
+
+    public void sortObjectEntities()
+    {
+        objectEntityAdapters.sort((entity1, entity2) ->
+            {
+                return ObjectUtils.compare(entity1.getNameProperty().get(), entity2.getNameProperty().get());
+            });
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/432e8bfe/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
new file mode 100644
index 0000000..18d58d7
--- /dev/null
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
@@ -0,0 +1,116 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+
+package org.apache.cayenne.modeler.adapters;
+
+import org.apache.cayenne.dba.TypesMapping;
+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>
+{
+    private final ObjAttribute objectAttribute;
+
+    private StringProperty nameProperty;
+    private StringProperty javaTypeProperty;
+    private StringProperty databaseAttributePathProperty;
+    private BooleanProperty usedForLockingProperty;
+
+//    private StringProperty locationProperty;
+//
+//    private BooleanProperty quoteSQLIdentifiersProperty;
+//
+//    private StringProperty defaultCatalogProperty;
+//    private StringProperty defaultSchemaProperty;
+//    private StringProperty defaultPackageProperty;
+//
+//    private StringProperty  defaultSuperclassProperty;
+//    private IntegerProperty defaultLockTypeProperty;
+//
+//    private BooleanProperty clientSupportedProperty;
+//    private StringProperty  defaultClientPackageProperty;
+//    private StringProperty  defaultClientSuperclassProperty;
+
+    public ObjectAttributeAdapter(final ObjAttribute objectAttribute)
+    {
+        this.objectAttribute = objectAttribute;
+
+        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();
+
+
+//            locationProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name("map").build();
+
+//            quoteSQLIdentifiersProperty = JavaBeanBooleanPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_QUOTE_SQL_IDENTIFIERS_PROPERTY).build();
+
+//            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();
+//
+//            defaultSuperclassProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_SUPERCLASS_PROPERTY).build();
+//            defaultLockTypeProperty   = JavaBeanIntegerPropertyBuilder.create().bean(dataMap).name(DataMap.DEFAULT_LOCK_TYPE_PROPERTY).build();
+//
+//            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();
+        }
+        catch (final NoSuchMethodException e)
+        {
+            throw new RuntimeException("Fix the builder.", e);
+        }
+
+//        objectAttribute.getDbAttribute().getName();
+    }
+
+    public StringProperty nameProperty() { return nameProperty; }
+    public String getName() { return nameProperty.get(); }
+    public void setName(final String value) { nameProperty.set(value); }
+
+    public StringProperty javaTypeProperty() { return javaTypeProperty; }
+    public String getJavaType() { return javaTypeProperty.get(); }
+    public void setJavaType(final String value) { javaTypeProperty.set(value); }
+
+    public StringProperty databaseAttributePathProperty() { return databaseAttributePathProperty;
}
+    public String getDatabaseAttributePath() { return databaseAttributePathProperty.get();
}
+    public void setDatabaseAttributePath(final String value) { databaseAttributePathProperty.set(value);
}
+
+    public BooleanProperty usedForLockingProperty() { return usedForLockingProperty; }
+    public Boolean getUsedForLocking() { return usedForLockingProperty.get(); }
+    public void setUsedForLocking(final Boolean value) { usedForLockingProperty.set(value);
}
+
+    public String getDatabaseType()
+    {
+        return TypesMapping.getSqlNameByType(objectAttribute.getDbAttribute().getType());
+    }
+    /**
+     * @return The underlying ObjAttribute fronted by this property adapter.
+     */
+    public ObjAttribute getObjAttribute()
+    {
+        return objectAttribute;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/432e8bfe/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 9cbab1f..15e50f2 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
@@ -19,17 +19,21 @@
 
 package org.apache.cayenne.modeler.adapters;
 
+import org.apache.cayenne.map.ObjAttribute;
 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;
 
 public class ObjectEntityAdapter extends CayennePropertyAdapter // implements AdapterSupport<DataMap>
 {
     private final ObjEntity objectEntity;
-//    private BeanPathAdapter<DataMap> dataMapAdapter;
+
+    private final ObservableList<ObjectAttributeAdapter> objectAttributeAdapters =
FXCollections.observableArrayList();
 
     private StringProperty nameProperty;
     private BooleanProperty abstractClassProperty;
@@ -78,6 +82,9 @@ public class ObjectEntityAdapter extends CayennePropertyAdapter // implements
Ad
         {
             throw new RuntimeException("Fix the builder.", e);
         }
+
+        for (final ObjAttribute objAttribute : objectEntity.getAttributes())
+            objectAttributeAdapters.add(new ObjectAttributeAdapter(objAttribute));
     }
 
     public StringProperty getNameProperty()
@@ -89,4 +96,9 @@ public class ObjectEntityAdapter extends CayennePropertyAdapter // implements
Ad
     {
         return abstractClassProperty;
     }
+
+    public ObservableList<ObjectAttributeAdapter> getAttributes()
+    {
+        return objectAttributeAdapters;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/432e8bfe/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityAttributesTabLayout.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityAttributesTabLayout.java
b/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityAttributesTabLayout.java
index c60a594..7a70a14 100644
--- a/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityAttributesTabLayout.java
+++ b/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityAttributesTabLayout.java
@@ -21,19 +21,21 @@ package org.apache.cayenne.modeler.layout;
 
 import java.io.IOException;
 
-import org.apache.cayenne.map.ObjAttribute;
-import org.apache.cayenne.map.ObjEntity;
+import org.apache.cayenne.modeler.adapters.ObjectAttributeAdapter;
 import org.apache.cayenne.modeler.adapters.ObjectEntityAdapter;
+import org.apache.cayenne.modeler.utility.ObjectEntityUtilities;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import de.jensd.fx.glyphs.GlyphsDude;
 import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon;
-import javafx.collections.FXCollections;
 import javafx.event.Event;
 import javafx.fxml.FXML;
+import javafx.scene.control.ComboBox;
+import javafx.scene.control.Label;
 import javafx.scene.control.TableColumn;
 import javafx.scene.control.TableView;
+import javafx.scene.control.TextField;
 import javafx.scene.control.cell.PropertyValueFactory;
 
 public class ObjectEntityAttributesTabLayout
@@ -43,20 +45,34 @@ public class ObjectEntityAttributesTabLayout
     private static final Log LOGGER = LogFactory.getLog(ObjectEntityAttributesTabLayout.class);
 
     @FXML
-    private TableView<ObjAttribute> attributesTableView;
+    private TextField javaAttributeNameTextField;
+    @FXML
+    private ComboBox<String> javaTypeComboBox;
+
+    @FXML
+    private TableView<ObjectAttributeAdapter> attributesTableView;
 
     @FXML
-    private TableColumn<ObjAttribute,String> attributeNameColumn;
+    private TableColumn<ObjectAttributeAdapter,String> attributeNameColumn;
 
     @FXML
-    private TableColumn<ObjAttribute,String> attributeTypeColumn;
+    private TableColumn<ObjectAttributeAdapter,String> attributeTypeColumn;
 //    private TableColumn<ObjAttribute,ComboBox<String>> attributeTypeColumn;
 
     @FXML
-    private TableColumn<ObjAttribute,Boolean> attributeUsedForLockingColumn;
+    private TableColumn<ObjectAttributeAdapter,String> attributeDatabasePathColumn;
+
+    @FXML
+    private TableColumn<ObjectAttributeAdapter,String> attributeDatabaseTypeColumn;
+
+    @FXML
+    private TableColumn<ObjectAttributeAdapter,Boolean> attributeUsedForLockingColumn;
 
     @FXML
-    private TableColumn<ObjAttribute,Boolean> attributeIsInheritedColumn;
+    private TableColumn<ObjectAttributeAdapter,Boolean> attributeIsInheritedColumn;
+
+    @FXML
+    private Label databaseTypeLabel;
 
 //    private MainWindowSupport parent;
 
@@ -82,9 +98,11 @@ public class ObjectEntityAttributesTabLayout
         attributeUsedForLockingColumn.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.LOCK,
"16px"));
         attributeIsInheritedColumn.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.LEVEL_UP,
"16px"));
 
-        attributeNameColumn.setCellValueFactory(new PropertyValueFactory("name"));
-//        attributeTypeColumn.setCellValueFactory(new PropertyValueFactory("type"));
-        attributeTypeColumn.setCellValueFactory(new PropertyValueFactory<ObjAttribute,
String>("type"));
+        attributeNameColumn.setCellValueFactory(new PropertyValueFactory<ObjectAttributeAdapter,String>("name"));
+        attributeTypeColumn.setCellValueFactory(new PropertyValueFactory<ObjectAttributeAdapter,String>("javaType"));
+        attributeDatabasePathColumn.setCellValueFactory(new PropertyValueFactory<ObjectAttributeAdapter,String>("databaseAttributePath"));
+        attributeDatabaseTypeColumn.setCellValueFactory(new PropertyValueFactory<ObjectAttributeAdapter,String>("databaseType"));
+        attributeUsedForLockingColumn.setCellValueFactory(new PropertyValueFactory<ObjectAttributeAdapter,Boolean>("usedForLocking"));
 
 //        Callback<TableColumn<ObjAttribute, String>, TableCell<ObjAttribute,
String>> comboBoxCellFactory
 //        = (TableColumn<ObjAttribute, String> param) -> new ComboBoxEditingCell();
@@ -130,13 +148,14 @@ public class ObjectEntityAttributesTabLayout
 //        }
 //    }
 
-    public void display(final ObjEntity objEntity)
-    {
-        LOGGER.debug("trying to display: " + objEntity);
-        attributesTableView.setItems(FXCollections.observableArrayList(objEntity.getAttributes()));
-//        objectEntityClassTabViewController.display(objEntity);
-//        objEntity.getAttributes()
-    }
+//    public void display(final ObjEntity objEntity)
+//    {
+//        LOGGER.debug("trying to display: " + objEntity);
+////        attributesTableView.setItems(FXCollections.observableArrayList(objEntity.getAttributes()));
+//
+////        objectEntityClassTabViewController.display(objEntity);
+////        objEntity.getAttributes()
+//    }
 
     public void tabChanged(final Event event)
     {
@@ -150,13 +169,65 @@ public class ObjectEntityAttributesTabLayout
         this.objectEntityAdapter = objectEntityAdapter;
     }
 
+    private ObjectAttributeAdapter currentObjectAttributeAdapter;
+
     @Override
     public void beginEditing()
     {
+//        nameTextField.textProperty().bindBidirectional(objectEntityAdapter.getNameProperty());
+
+        javaAttributeNameTextField.setDisable(true);
+        javaAttributeNameTextField.setText(null);
+        javaTypeComboBox.setDisable(true);
+        javaTypeComboBox.getItems().clear();
+        javaTypeComboBox.setValue(null);
+        databaseTypeLabel.setText("N/A");
+        attributesTableView.setItems(objectEntityAdapter.getAttributes());
+
+        attributesTableView.getSelectionModel().selectedItemProperty().addListener((obs,
oldSelection, newSelection) ->
+            {
+                final String[] javaTypes = ObjectEntityUtilities.getRegisteredTypeNames();
+
+                currentObjectAttributeAdapter = newSelection;
+
+                if (oldSelection != null)
+                {
+                    javaAttributeNameTextField.textProperty().unbindBidirectional(oldSelection.nameProperty());
+                    javaTypeComboBox.valueProperty().unbindBidirectional(oldSelection.javaTypeProperty());
+
+//                    javaTypeComboBox.textProperty().unbindBidirectional(oldSelection.javaTypeProperty());
+                }
+
+                javaTypeComboBox.getItems().clear();
+
+                if (newSelection != null)
+                {
+                    javaTypeComboBox.getItems().addAll(javaTypes);
+
+                    javaAttributeNameTextField.textProperty().bindBidirectional(newSelection.nameProperty());
+                    javaTypeComboBox.valueProperty().bindBidirectional(newSelection.javaTypeProperty());
+//                    javaTypeComboBox.textProperty().bindBidirectional(oldSelection.javaTypeProperty());
+                    databaseTypeLabel.setText(newSelection.getDatabaseType());
+                }
+
+                javaAttributeNameTextField.setDisable(newSelection == null);
+                javaTypeComboBox.setDisable(newSelection == null);
+            });
     }
 
     @Override
     public void endEditing()
     {
+//        nameTextField.textProperty().unbindBidirectional(objectEntityAdapter.getNameProperty());
+
+        if (currentObjectAttributeAdapter != null)
+        {
+            javaAttributeNameTextField.textProperty().unbindBidirectional(currentObjectAttributeAdapter.nameProperty());
+            javaTypeComboBox.valueProperty().unbindBidirectional(currentObjectAttributeAdapter.javaTypeProperty());
+
+            currentObjectAttributeAdapter = null;
+        }
+
+//        attributesTableView.setItems(null);
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/432e8bfe/src/main/resources/layouts/ObjectEntityAttributesTabLayout.fxml
----------------------------------------------------------------------
diff --git a/src/main/resources/layouts/ObjectEntityAttributesTabLayout.fxml b/src/main/resources/layouts/ObjectEntityAttributesTabLayout.fxml
index 9ee2e3e..4e60fc2 100644
--- a/src/main/resources/layouts/ObjectEntityAttributesTabLayout.fxml
+++ b/src/main/resources/layouts/ObjectEntityAttributesTabLayout.fxml
@@ -24,7 +24,6 @@
 <?import java.lang.*?>
 <?import javafx.scene.layout.*?>
 
-
 <fx:root maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
prefHeight="616.0" prefWidth="868.0" type="AnchorPane" xmlns="http://javafx.com/javafx/8.0.40"
xmlns:fx="http://javafx.com/fxml/1">
    <children>
       <VBox layoutX="10.0" layoutY="10.0" minHeight="400.0" AnchorPane.bottomAnchor="0.0"
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
@@ -46,8 +45,8 @@
                   <TableColumn fx:id="attributeUsedForLockingColumn" editable="false"
maxWidth="25.0" minWidth="25.0" prefWidth="25.0" resizable="false" sortable="false" text="L"
/>
                   <TableColumn fx:id="attributeNameColumn" maxWidth="1.7976931348623157E308"
minWidth="-1.0" prefWidth="225.0" text="Java Attribute" />
                   <TableColumn fx:id="attributeTypeColumn" maxWidth="1.7976931348623157E308"
minWidth="-1.0" prefWidth="225.0" text="Java Type" />
-                  <TableColumn maxWidth="1.7976931348623157E308" minWidth="-1.0" prefWidth="225.0"
text="Database Column" />
-                  <TableColumn maxWidth="1.7976931348623157E308" minWidth="-1.0" prefWidth="125.0"
text="Database Type" />
+                  <TableColumn fx:id="attributeDatabasePathColumn" maxWidth="1.7976931348623157E308"
minWidth="-1.0" prefWidth="225.0" text="Database Attribute Path" />
+                  <TableColumn fx:id="attributeDatabaseTypeColumn" editable="false" maxWidth="1.7976931348623157E308"
minWidth="-1.0" prefWidth="125.0" text="Database Type" />
                </columns>
             </TableView>
             <GridPane vgap="6.0" VBox.vgrow="NEVER">
@@ -64,12 +63,12 @@
                </rowConstraints>
                <children>
                   <Label text="Java Attribute Name: " />
-                  <Label text="Database Column Name: " GridPane.rowIndex="1" />
+                  <Label text="Database Attribute Path: " GridPane.rowIndex="1" />
                   <Label text="Java Type: " GridPane.columnIndex="2" />
                   <Label text="Database Type: " GridPane.columnIndex="2" GridPane.rowIndex="1"
/>
-                  <TextField maxWidth="-Infinity" minWidth="-Infinity" prefWidth="200.0"
GridPane.columnIndex="1" />
-                  <Label text="type name here" GridPane.columnIndex="3" GridPane.rowIndex="1"
/>
-                  <ComboBox editable="true" maxWidth="-Infinity" minWidth="-Infinity"
prefWidth="200.0" promptText="Enter or Choose..." GridPane.columnIndex="3" />
+                  <TextField fx:id="javaAttributeNameTextField" maxWidth="-Infinity" minWidth="-Infinity"
prefWidth="200.0" GridPane.columnIndex="1" />
+                  <Label fx:id="databaseTypeLabel" text="type name here" GridPane.columnIndex="3"
GridPane.rowIndex="1" />
+                  <ComboBox fx:id="javaTypeComboBox" editable="true" maxWidth="-Infinity"
minWidth="-Infinity" prefWidth="200.0" promptText="Enter or Choose..." GridPane.columnIndex="3"
/>
                   <CheckBox mnemonicParsing="false" text="Optimistic Locking" GridPane.columnIndex="4"
/>
                   <ComboBox maxWidth="-Infinity" minWidth="-Infinity" prefWidth="200.0"
GridPane.columnIndex="1" GridPane.rowIndex="1" />
                </children>

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/432e8bfe/src/main/resources/layouts/ObjectEntityClassTabLayout.fxml
----------------------------------------------------------------------
diff --git a/src/main/resources/layouts/ObjectEntityClassTabLayout.fxml b/src/main/resources/layouts/ObjectEntityClassTabLayout.fxml
index d179d9e..f3681f3 100644
--- a/src/main/resources/layouts/ObjectEntityClassTabLayout.fxml
+++ b/src/main/resources/layouts/ObjectEntityClassTabLayout.fxml
@@ -44,8 +44,9 @@
             </Label>
             <GridPane minHeight="-Infinity" vgap="4.0">
                <columnConstraints>
-                  <ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="-Infinity"
minWidth="-Infinity" prefWidth="225.0" />
-                  <ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity"
prefWidth="500.0" />
+                  <ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="-Infinity"
minWidth="-Infinity" prefWidth="175.0" />
+                  <ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity"
/>
+                  <ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="10.0"
/>
                </columnConstraints>
                <rowConstraints>
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"
/>
@@ -63,12 +64,12 @@
                   <Label alignment="CENTER_RIGHT" text="Class Name: " GridPane.rowIndex="3"
/>
                   <TextField maxWidth="-Infinity" minWidth="-Infinity" prefWidth="360.0"
promptText="ClassName" GridPane.columnIndex="1" GridPane.rowIndex="3" />
                   <Label text="Inheritance: " GridPane.rowIndex="5" />
-                  <CheckBox fx:id="abstractClassCheckbox" mnemonicParsing="false" text="Abstract
Class" GridPane.columnIndex="1" />
+                  <CheckBox fx:id="abstractClassCheckbox" mnemonicParsing="false" text="Abstract
Class" GridPane.columnIndex="2" GridPane.rowIndex="3" />
                   <ComboBox prefWidth="360.0" GridPane.columnIndex="1" GridPane.rowIndex="5"
/>
-                  <Label text="Mapped to Database Table/View: " GridPane.rowIndex="4"
/>
+                  <Label text="Database Table/View: " GridPane.rowIndex="4" />
                   <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1"
GridPane.rowIndex="4">
                      <children>
-                        <ComboBox prefWidth="200.0" />
+                        <ComboBox prefWidth="200.0" promptText="Java -&gt; Database"
/>
                         <Pane maxWidth="-Infinity" minWidth="-Infinity" prefWidth="20.0"
/>
                         <Button fx:id="dbEntitySyncButton" maxWidth="-Infinity" minWidth="-Infinity"
mnemonicParsing="false" prefWidth="140.0" text="Sync to DbEntity" textAlignment="CENTER" HBox.hgrow="SOMETIMES">
                            <font>
@@ -95,6 +96,8 @@
                   </HBox>
                   <CheckBox mnemonicParsing="false" text="Exclude Superclass Listeners"
GridPane.columnIndex="1" GridPane.rowIndex="8" />
                   <CheckBox mnemonicParsing="false" text="Exclude Default Listeners" GridPane.columnIndex="1"
GridPane.rowIndex="9" />
+                  <Label text="Name: " />
+                  <TextField fx:id="nameTextField" maxWidth="-Infinity" minWidth="-Infinity"
prefWidth="225.0" promptText="Object Entity Name" GridPane.columnIndex="1" />
                </children>
             </GridPane>
             <TabPane minWidth="100.0" prefHeight="200.0" tabClosingPolicy="UNAVAILABLE"
VBox.vgrow="ALWAYS">


Mime
View raw message