cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abulat...@apache.org
Subject [cayenne] branch STABLE-4.0 updated: CAY-2417 Modeler: wrong title in attribute context menu
Date Wed, 12 Jun 2019 13:20:23 GMT
This is an automated email from the ASF dual-hosted git repository.

abulatski pushed a commit to branch STABLE-4.0
in repository https://gitbox.apache.org/repos/asf/cayenne.git


The following commit(s) were added to refs/heads/STABLE-4.0 by this push:
     new 92d6a86  CAY-2417 Modeler: wrong title in attribute context menu
92d6a86 is described below

commit 92d6a86cb9fca960efd25a829f040f79b31c3677
Author: Arseni Bulatski <ancarseni@gmail.com>
AuthorDate: Wed Jun 12 15:20:00 2019 +0300

    CAY-2417 Modeler: wrong title in attribute context menu
    
    (cherry picked from commit 1ec001703a6cc1647d0ad8145b28877121798823)
---
 RELEASE-NOTES.txt                                  |  1 +
 .../editor/dbentity/DbEntityAttributePanel.java    | 32 ++++++++++++++--------
 .../editor/dbentity/DbEntityRelationshipPanel.java |  9 ++++++
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index f1f7998..4c70b54 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -19,6 +19,7 @@ CAY-2570 Use MySQL adapter for latest versions of MariaDB
 
 Bug Fixes:
 
+CAY-2417 Modeler: wrong title in attribute context menu
 CAY-2550 Modeler: ObjAttribute inspector modifies wrong columns in attribute table
 CAY-2553 Wrong disjoint prefetch query qualifier
 CAY-2559 Modeler: Warning dialog shows wrong information after changing target entity in
dbRelationship
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributePanel.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributePanel.java
index adccd1b..960a053 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributePanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributePanel.java
@@ -18,6 +18,17 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.editor.dbentity;
 
+import javax.swing.JComboBox;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableColumn;
+import java.awt.BorderLayout;
+import java.util.List;
+
 import org.apache.cayenne.dba.TypesMapping;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
@@ -41,17 +52,6 @@ import org.apache.cayenne.modeler.util.UIUtil;
 import org.apache.cayenne.modeler.util.combo.AutoCompletion;
 import org.apache.cayenne.swing.components.LimitedTextField;
 
-import javax.swing.JComboBox;
-import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.table.TableCellEditor;
-import javax.swing.table.TableColumn;
-import java.awt.BorderLayout;
-import java.util.List;
-
 /**
  * Detail view of the DbEntity attributes.
  */
@@ -120,6 +120,16 @@ public class DbEntityAttributePanel extends JPanel implements DbEntityDisplayLis
         List<?> listAttrs = model.getObjectList();
         int[] newSel = new int[attrs.length];
 
+        Application.getInstance().getActionManager()
+                .getAction(RemoveAttributeRelationshipAction.class)
+                .setCurrentSelectedPanel(parentPanel.getAttributePanel());
+        Application.getInstance().getActionManager()
+                .getAction(CutAttributeRelationshipAction.class)
+                .setCurrentSelectedPanel(parentPanel.getAttributePanel());
+        Application.getInstance().getActionManager()
+                .getAction(CopyAttributeRelationshipAction.class)
+                .setCurrentSelectedPanel(parentPanel.getAttributePanel());
+
         parentPanel.updateActions(attrs);
 
         for (int i = 0; i < attrs.length; i++) {
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipPanel.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipPanel.java
index cfb3163..ed9ab31 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipPanel.java
@@ -183,6 +183,15 @@ public class DbEntityRelationshipPanel extends JPanel implements DbEntityDisplay
         List listRels = model.getObjectList();
         int[] newSel = new int[rels.length];
 
+        Application.getInstance().getActionManager()
+                .getAction(RemoveAttributeRelationshipAction.class)
+                .setCurrentSelectedPanel(parentPanel.getRelationshipPanel());
+        Application.getInstance().getActionManager()
+                .getAction(CutAttributeRelationshipAction.class)
+                .setCurrentSelectedPanel(parentPanel.getRelationshipPanel());
+        Application.getInstance().getActionManager()
+                .getAction(CopyAttributeRelationshipAction.class)
+                .setCurrentSelectedPanel(parentPanel.getRelationshipPanel());
         parentPanel.updateActions(rels);
 
         for (int i = 0; i < rels.length; i++) {


Mime
View raw message