JAL-4213 don’t pass active selection when actioning the addReferenceAnnotation
[jalview.git] / src / jalview / gui / PopupMenu.java
index 1c03d6a..88c1292 100644 (file)
@@ -1734,10 +1734,9 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
   protected void addReferenceAnnotations_actionPerformed(
           Map<SequenceI, List<AlignmentAnnotation>> candidates)
   {
-    final SequenceGroup selectionGroup = this.ap.av.getSelectionGroup();
     final AlignmentI alignment = this.ap.getAlignment();
     AlignmentUtils.addReferenceAnnotations(candidates, alignment,
-            selectionGroup);
+            null);
     refresh();
   }
 
@@ -1990,7 +1989,6 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
               sg.setName(dialog.getName());
               sg.setDescription(dialog.getDescription());
               refresh();
-              return null;
             });
   }
 
@@ -2028,12 +2026,17 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
               {
                 if (dialog.getName().indexOf(" ") > -1)
                 {
-                  JvOptionPane.showMessageDialog(ap,
-                          MessageManager.getString(
-                                  "label.spaces_converted_to_underscores"),
-                          MessageManager.getString(
-                                  "label.no_spaces_allowed_sequence_name"),
-                          JvOptionPane.WARNING_MESSAGE);
+                  String ok = MessageManager.getString("action.ok");
+                  String cancel = MessageManager.getString("action.cancel");
+                  String message = MessageManager.getString(
+                          "label.spaces_converted_to_underscores");
+                  String title = MessageManager.getString(
+                          "label.no_spaces_allowed_sequence_name");
+                  Object[] options = new Object[] { ok, cancel };
+
+                  JvOptionPane.frameDialog(message, title,
+                          JvOptionPane.WARNING_MESSAGE, null, null, null,
+                          false);
                 }
                 sequence.setName(dialog.getName().replace(' ', '_'));
                 ap.paintAlignment(false, false);
@@ -2041,7 +2044,6 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
               sequence.setDescription(dialog.getDescription());
               ap.av.firePropertyChange("alignment", null,
                       ap.av.getAlignment().getSequences());
-              return null;
             });
   }
 
@@ -2276,7 +2278,6 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
                 ap.alignFrame.addHistoryItem(editCommand);
                 ap.av.firePropertyChange("alignment", null,
                         ap.av.getAlignment().getSequences());
-                return null;
               });
     }
   }