cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [13/50] cayenne-modeler git commit: Automatically select row.
Date Thu, 05 Jan 2017 22:09:21 GMT
Automatically select row.


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

Branch: refs/heads/master
Commit: ffa3dcefbbe71968fb4f07f07e8d95afe6bebf60
Parents: a6139a0
Author: mrg <blacknext@gmail.com>
Authored: Mon Sep 26 09:38:14 2016 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Mon Sep 26 09:38:14 2016 -0400

----------------------------------------------------------------------
 .../modeler/layout/ObjectEntityAttributesTabLayout.java      | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/ffa3dcef/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 d96bd25..3a2b3df 100644
--- a/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityAttributesTabLayout.java
+++ b/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityAttributesTabLayout.java
@@ -202,13 +202,19 @@ public class ObjectEntityAttributesTabLayout
     {
         javaAttributeNameTextField.setDisable(true);
         javaAttributeNameTextField.setText(null);
+
         javaTypeComboBox.setDisable(true);
         javaTypeComboBox.getItems().clear();
         javaTypeComboBox.setValue(null);
+
         databaseTypeLabel.setText("N/A");
-        attributesTableView.setItems(objectEntityAdapter.getAttributes());
 
+        attributesTableView.setItems(objectEntityAdapter.getAttributes());
         attributesTableView.getSelectionModel().selectedItemProperty().addListener(attributesTableViewSelectionListener);
+
+        // Automatically select the first item, if available.
+        if (attributesTableView.getItems().size() > 0)
+            attributesTableView.getSelectionModel().select(0);
     }
 
     @Override


Mime
View raw message