cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [1/2] cayenne git commit: Modeler bug fix
Date Mon, 10 Dec 2018 08:55:42 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 89f5e9860 -> c0c14636b


Modeler bug fix


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

Branch: refs/heads/master
Commit: a25c694b52640cb3f8ebed2e4be8e266e99b7c1c
Parents: 34ad525
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Mon Dec 3 12:48:02 2018 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Mon Dec 3 12:48:02 2018 +0300

----------------------------------------------------------------------
 .../java/org/apache/cayenne/modeler/ProjectTreeView.java  | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/a25c694b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
index 3cca6e9..5503bbd 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
@@ -644,6 +644,8 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
                 .getDataDomainChildrenComparator());
         if(!Application.getInstance().getFrameController().getDbImportController().isGlobalImport())
{
             showNode(newMapNode);
+        } else {
+            setSelected(newMapNode);
         }
     }
 
@@ -818,6 +820,14 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
         setSelectionPath(path);
     }
 
+    /** Makes node current, visible but not selected. */
+    private void setSelected(DefaultMutableTreeNode node) {
+        TreePath path = new TreePath(node.getPath());
+        if(!isVisible(path)) {
+            makeVisible(path);
+        }
+    }
+
     protected void showNode(Object[] path) {
         if (path == null) {
             return;


Mime
View raw message