Repository: cayenne
Updated Branches:
  refs/heads/master 0349c974f -> 5505164e9


CAY-2418 Modeler: unable to edit entity selected via Search
 - fix for ObjAttributes


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

Branch: refs/heads/master
Commit: 5505164e9091e0b20399ab53ea3f5961c43be844
Parents: 0349c97
Author: Nikita Timofeev <stari...@gmail.com>
Authored: Thu May 17 17:21:26 2018 +0300
Committer: Nikita Timofeev <stari...@gmail.com>
Committed: Thu May 17 17:21:26 2018 +0300

----------------------------------------------------------------------
 .../modeler/editor/ObjEntityAttributePanel.java | 34 ++++++++++----------
 1 file changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/5505164e/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
----------------------------------------------------------------------
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
index 7cae33e..527acc2 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
@@ -173,27 +173,24 @@ public class ObjEntityAttributePanel extends JPanel 
implements ObjEntityDisplayL
         mediator.addObjEntityListener(this);
         mediator.addObjAttributeListener(this);
 
-        resolver = new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                int row = table.getSelectedRow();
-                if (row < 0) {
-                    return;
-                }
+        resolver = e -> {
+            int row = table.getSelectedRow();
+            if (row < 0) {
+                return;
+            }
 
-                ObjAttributeTableModel model = (ObjAttributeTableModel) 
table.getModel();
+            ObjAttributeTableModel model = (ObjAttributeTableModel) 
table.getModel();
 
-                // ... show dialog...
-                new ObjAttributeInfoDialog(mediator, row, 
model).startupAction();
+            // ... show dialog...
+            new ObjAttributeInfoDialog(mediator, row, model).startupAction();
 
-                // This is required for a table to be updated properly
-                table.cancelEditing();
+            // This is required for a table to be updated properly
+            table.cancelEditing();
 
-                // need to refresh selected row... do this by 
unselecting/selecting the row
-                table.getSelectionModel().clearSelection();
-                table.select(row);
-                enabledResolve = false;
-            }
+            // need to refresh selected row... do this by 
unselecting/selecting the row
+            table.getSelectionModel().clearSelection();
+            table.select(row);
+            enabledResolve = false;
         };
         resolveMenu.addActionListener(resolver);
 
@@ -249,6 +246,9 @@ public class ObjEntityAttributePanel extends JPanel 
implements ObjEntityDisplayL
         }
 
         table.select(newSel);
+
+        parentPanel.getResolve().removeActionListener(getResolver());
+        parentPanel.getResolve().addActionListener(getResolver());
     }
 
     public void objAttributeChanged(AttributeEvent e) {

Reply via email to