- String title = forCreate
- ? MessageManager.getString("label.create_new_sequence_features")
- : MessageManager.formatMessage("label.amend_delete_features",
- new String[]
- { sequences.get(0).getName() });
-
- JvOptionPane.newOptionDialog(Desktop.desktop).response(okAction)
- .response(deleteAction).defaultResponse(cancelAction)
- .showInternalDialog(mainPanel, title,
- JvOptionPane.YES_NO_CANCEL_OPTION,
- JvOptionPane.QUESTION_MESSAGE, null, options,
- MessageManager.getString("action.ok"));
+ /*
+ * set dialog action handlers for OK (create/Amend) and Cancel options
+ * also for Delete if applicable (when amending features)
+ */
+ JvOptionPane dialog = JvOptionPane.newOptionDialog(ap.alignFrame)
+ .setResponseHandler(0, okAction)
+ .setResponseHandler(2, cancelAction);
+ if (!forCreate)
+ {
+ dialog.setResponseHandler(1, getDeleteAction());
+ }
+
+ String title = null;
+ Object[] options = null;
+ if (forCreate)
+ {
+ title = MessageManager
+ .getString("label.create_new_sequence_features");
+ options = new Object[] { MessageManager.getString("action.ok"),
+ MessageManager.getString("action.cancel") };
+ }
+ else
+ {
+ title = MessageManager.formatMessage("label.amend_delete_features",
+ new String[]
+ { sequences.get(0).getName() });
+ options = new Object[] { MessageManager.getString("label.amend"),
+ MessageManager.getString("action.delete"),
+ MessageManager.getString("action.cancel") };
+ }
+
+ dialog.showInternalDialog(mainPanel, title,
+ JvOptionPane.YES_NO_CANCEL_OPTION, JvOptionPane.PLAIN_MESSAGE,
+ null, options, MessageManager.getString("action.ok"));