cayenne-commits mailing list archives

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

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


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

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

    CAY-2417 Modeler: wrong title in attribute context menu
---
 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 432f6cb..1fa3317 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -38,6 +38,7 @@ CAY-2570 Use MySQL adapter for latest versions of MariaDB
 Bug Fixes:
 
 CAY-2332 Property API: unable to use eq() and in() methods for toMany relationships
+CAY-2417 Modeler: wrong title in attribute context menu
 CAY-2506 Java class generated for Embeddable object is not serializable
 CAY-2509 Result of resolving lazily faulted relationships can be out-of-date
 CAY-2530 Modeler: DB Import and Class Generation from Project is performed for removed datamaps
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 788dde1..3f789c6 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 ad0c9ea..9308065 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
@@ -177,6 +177,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