- String theTitle = MessageManager.formatMessage(
- "label.select_character_style_title", formatType);
- dialog = pane.createDialog(Desktop.desktop, theTitle);
- dialog.setVisible(true);
+ /**
+ * Registers a Runnable action to be performed for a particular user response
+ * in the dialog
+ *
+ * @param action
+ */
+ public void setResponseAction(Object response, Callable action)
+ {
+ dialog.setResponseHandler(response, action);
+ }
+
+ /**
+ * Shows the dialog, and performs any registered actions depending on the user
+ * choices
+ */
+ public void showDialog()
+ {
+ Object[] options = new Object[] { MessageManager.getString("action.ok"),
+ MessageManager.getString("action.cancel") };
+ dialog.showInternalDialog(this, dialogTitle,
+ JvOptionPane.OK_CANCEL_OPTION, JvOptionPane.PLAIN_MESSAGE, null,
+ options, MessageManager.getString("action.ok"));