cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abulat...@apache.org
Subject cayenne git commit: CAY-2502 DataMap in DataNode tree view disappears after dbImport
Date Wed, 12 Dec 2018 08:03:37 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master cd15b43f8 -> 82d1c06d5


CAY-2502 DataMap in DataNode tree view disappears after dbImport


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

Branch: refs/heads/master
Commit: 82d1c06d51815676eede98bb2eef69cdc2a023b1
Parents: cd15b43
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Wed Dec 12 11:03:19 2018 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Wed Dec 12 11:03:19 2018 +0300

----------------------------------------------------------------------
 RELEASE-NOTES.txt                                     |  1 +
 .../org/apache/cayenne/modeler/ProjectController.java |  3 ++-
 .../org/apache/cayenne/modeler/ProjectTreeView.java   | 14 +++++++++++---
 3 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/82d1c06d/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 1ee77c6..90ec498 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -51,6 +51,7 @@ CAY-2490 Added dbEntities from other datamaps in dbRelationship dialog.
 CAY-2496 Fixed wrong table behavior: focus color, cleanup DBAttribute Path cell on select.
 CAY-2497 Modeler: SQL Scripts tab isn't scrollable
 CAY-2501 Modeler: DbImport ui not loading columns for MySQL connector v8.0
+CAY-2502 DataMap in DataNode tree view disappears after dbImport
 
 ----------------------------------
 Release: 4.1.M2

http://git-wip-us.apache.org/repos/asf/cayenne/blob/82d1c06d/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectController.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectController.java
index b385d75..b442daf 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectController.java
@@ -851,6 +851,7 @@ public class ProjectController extends CayenneController {
         if (!changed) {
             changed = currentState.dbEntity != null || currentState.objEntity != null ||
currentState.procedure != null
                     || currentState.query != null || currentState.embeddable != null;
+            currentState.node = e.getDataNode();
         }
 
         if (!e.isRefired()) {
@@ -859,7 +860,7 @@ public class ProjectController extends CayenneController {
             if (changed) {
                 clearState();
                 currentState.domain = e.getDomain();
-                currentState.node = e.getDataNode();
+                currentState.node  = e.getDataNode();
                 currentState.map = e.getDataMap();
             }
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/82d1c06d/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 5503bbd..c9fddb5 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
@@ -628,11 +628,11 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
     }
 
     public void dataMapAdded(DataMapEvent e) {
+        DataChannelDescriptor dataChannelDescriptor = e.getDomain() != null ? e.getDomain()
:
+                (DataChannelDescriptor) mediator.getProject().getRootNode();
         DefaultMutableTreeNode domainNode = getProjectModel().getNodeForObjectPath(
                 new Object[] {
-                    e.getDomain() != null
-                            ? e.getDomain()
-                            : (DataChannelDescriptor) mediator.getProject().getRootNode()
+                   dataChannelDescriptor
                 });
 
         DefaultMutableTreeNode newMapNode = ProjectTreeFactory.wrapProjectNode(e
@@ -647,6 +647,14 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
         } else {
             setSelected(newMapNode);
         }
+
+        for (DataNodeDescriptor dataNode : new ArrayList<>(dataChannelDescriptor.getNodeDescriptors()))
{
+            for(String dataMapName : dataNode.getDataMapNames()) {
+                if(e.getDataMap().getName().equals(dataMapName)) {
+                    mediator.fireDataNodeEvent(new DataNodeEvent(this, dataNode));
+                }
+            }
+        }
     }
 
     public void dataMapRemoved(DataMapEvent e) {


Mime
View raw message