X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FEditNameDialog.java;h=ff0fe3a8a7b7f6e4f76f9f3fa0d0aeed70860aa2;hb=a7bc89415a6749ff89eb97f75fbc950a433a4935;hp=bbb7a20a56e4f087fbeac029e671d868975c1222;hpb=2e02b14ba33c2cf4618f65c831a506f81e621589;p=jalview.git diff --git a/src/jalview/gui/EditNameDialog.java b/src/jalview/gui/EditNameDialog.java index bbb7a20..ff0fe3a 100644 --- a/src/jalview/gui/EditNameDialog.java +++ b/src/jalview/gui/EditNameDialog.java @@ -20,11 +20,9 @@ */ package jalview.gui; -import jalview.util.MessageManager; -import jalview.util.dialogrunner.RunResponse; - import java.awt.FlowLayout; import java.awt.Font; +import java.util.concurrent.Callable; import javax.swing.BoxLayout; import javax.swing.JButton; @@ -33,6 +31,8 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; +import jalview.util.MessageManager; + /** * A dialog where a name and description may be edited */ @@ -40,6 +40,7 @@ public class EditNameDialog { private static final Font COURIER_12 = new Font("Courier", Font.PLAIN, 12); + JTextField id; JTextField description; @@ -107,18 +108,15 @@ public class EditNameDialog } /** - * Shows the dialog, and runs the response action if OK is selected. Note the - * RunResponse should be constructed to act on dialog return value - * JvOptionPane.OK_OPTION. + * Shows the dialog, and runs the response action if OK is selected * * @param action */ - public void showDialog(JComponent parent, String title, - RunResponse action) + public void showDialog(JComponent parent, String title, Callable action) { Object[] options = new Object[] { MessageManager.getString("action.ok"), MessageManager.getString("action.cancel") }; - JvOptionPane.newOptionDialog(parent).addResponse(action) + JvOptionPane.newOptionDialog(parent).setResponseHandler(0, action) .showInternalDialog(panel, title, JvOptionPane.YES_NO_CANCEL_OPTION, JvOptionPane.PLAIN_MESSAGE, null, options,