cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [28/50] cayenne-modeler git commit: Added code to prevent empty project tree selection.
Date Thu, 05 Jan 2017 22:09:36 GMT
Added code to prevent empty project tree selection.


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

Branch: refs/heads/master
Commit: 5e22d24629f6fac586bb5db71c1fddf0ff791575
Parents: 4e7debc
Author: mrg <blacknext@gmail.com>
Authored: Sat Oct 8 06:50:44 2016 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Sat Oct 8 06:50:44 2016 -0400

----------------------------------------------------------------------
 .../cayenne/modeler/layout/MainWindowLayout.java    | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/5e22d246/src/main/java/org/apache/cayenne/modeler/layout/MainWindowLayout.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/layout/MainWindowLayout.java b/src/main/java/org/apache/cayenne/modeler/layout/MainWindowLayout.java
index 2dea597..ce9f898 100644
--- a/src/main/java/org/apache/cayenne/modeler/layout/MainWindowLayout.java
+++ b/src/main/java/org/apache/cayenne/modeler/layout/MainWindowLayout.java
@@ -129,6 +129,8 @@ public class MainWindowLayout
 
         treeView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue,
newValue) ->
         {
+            LOGGER.debug("observable: " + observable + ", new: " + newValue + ", old: " +
oldValue);
+
             if (oldValue != null)
             {
                 final DetailEditorSupport<?> detailEditor = getDetailEditor(oldValue);
@@ -141,10 +143,9 @@ public class MainWindowLayout
             {
                 observable.getValue().getParent();
 //                System.out.println("observable: " + observable.getValue() + ", new: " +
newValue.getValue() + ", old: " + oldValue.getValue());
-                LOGGER.debug("observable: " + observable + ", new: " + newValue + ", old:
" + oldValue);
 
-                LOGGER.debug(observable.getValue().getValue().getClass());
-                LOGGER.debug(newValue.getValue().getClass());
+//                LOGGER.debug(observable.getValue().getValue().getClass());
+//                LOGGER.debug(newValue.getValue().getClass());
 
                 if (newValue instanceof DataDomainTreeItem)
                     displayDataDomain((DataDomainTreeItem) newValue);
@@ -168,6 +169,11 @@ public class MainWindowLayout
 //                else if (newValue.getValue() instanceof DatabaseEntityTreeViewModel)
 //                    displayDatabaseEntity((DatabaseEntityTreeViewModel) newValue.getValue());
             }
+            else
+            {
+                treeView.getSelectionModel().select(0);
+
+            }
         });
 
         setTitle();
@@ -178,8 +184,8 @@ public class MainWindowLayout
 
         addDataDomain();
 
-        treeView.getSelectionModel().select(0);
         treeView.requestFocus();
+        treeView.getSelectionModel().select(0);
     }
 
     private void addDataDomain()
@@ -198,7 +204,7 @@ public class MainWindowLayout
         for (final DataNodeAdapter dataNodeAdapter : cayenneProject.getDataDomainAdapter().getDataNodeAdapters())
             addDataNode(dataNodeAdapter, dataDomainBranch);
 
-        treeView.getSelectionModel().select(dataDomainBranch);
+//        treeView.getSelectionModel().select(dataDomainBranch);
     }
 
     private void addDataMap(final DataMapAdapter dataMapAdapter, final DataDomainTreeItem
dataDomainBranch)


Mime
View raw message