import jalview.schemes.FeatureColour;
import jalview.util.ColorUtils;
import jalview.util.MessageManager;
-import jalview.util.dialogrunner.RunResponse;
import java.awt.BorderLayout;
import java.awt.Color;
*/
public void showDialog()
{
- RunResponse okAction = forCreate ? getCreateAction() : getAmendAction();
- RunResponse cancelAction = getCancelAction();
+ Runnable okAction = forCreate ? getCreateAction() : getAmendAction();
+ Runnable cancelAction = getCancelAction();
/*
* set dialog action handlers for OK (create/Amend) and Cancel options
* also for Delete if applicable (when amending features)
*/
JvOptionPane dialog = JvOptionPane.newOptionDialog(Desktop.desktop)
- .response(okAction).response(cancelAction);
+ .setResponseHandler(0, okAction).setResponseHandler(2, cancelAction);
if (!forCreate)
{
- dialog.response(getDeleteAction());
+ dialog.setResponseHandler(1, getDeleteAction());
}
String title = null;
*
* @return
*/
- protected RunResponse getCancelAction()
+ protected Runnable getCancelAction()
{
- RunResponse okAction = new RunResponse(JvOptionPane.CANCEL_OPTION)
+ Runnable okAction = new Runnable()
{
@Override
public void run()
*
* @return
*/
- protected RunResponse getCreateAction()
+ protected Runnable getCreateAction()
{
- RunResponse okAction = new RunResponse(JvOptionPane.OK_OPTION)
+ Runnable okAction = new Runnable()
{
boolean useLastDefaults = features.get(0).getType() == null;
*
* @return
*/
- protected RunResponse getDeleteAction()
+ protected Runnable getDeleteAction()
{
- RunResponse deleteAction = new RunResponse(JvOptionPane.NO_OPTION)
+ Runnable deleteAction = new Runnable()
{
public void run()
{
*
* @return
*/
- protected RunResponse getAmendAction()
+ protected Runnable getAmendAction()
{
- RunResponse okAction = new RunResponse(JvOptionPane.OK_OPTION)
+ Runnable okAction = new Runnable()
{
boolean useLastDefaults = features.get(0).getType() == null;