X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FJvOptionPane.java;h=a141e14fd98991057deb86b0372765f62704f94d;hb=80e3ac6ebcb27e0d13ce639d1c3105f7cd6f83fe;hp=89899e2532bf50f5cbde66ae708b6aa216ff0637;hpb=13391b836bdc59c53cd8e8aba8d449629307d9b7;p=jalview.git diff --git a/src/jalview/gui/JvOptionPane.java b/src/jalview/gui/JvOptionPane.java index 89899e2..a141e14 100644 --- a/src/jalview/gui/JvOptionPane.java +++ b/src/jalview/gui/JvOptionPane.java @@ -482,6 +482,25 @@ public class JvOptionPane extends JOptionPane } /** + * adds inital selection value + * + * @param message + * @param initialSelectionValue + * @return + */ + public static String showInputDialog(Object message, + Object initialSelectionValue) + { + if (!isInteractiveMode()) + { + return getMockResponse().toString(); + } + + // AnnotationPanel character option + + return JOptionPane.showInputDialog(message, initialSelectionValue); + } + /** * centered on parent * * @param parentComponent @@ -518,6 +537,27 @@ public class JvOptionPane extends JOptionPane initialSelectionValue) : getMockResponse().toString(); } + + + /** + * input with initial selection + * + * @param parentComponent + * @param message + * @param initialSelectionValue + * @return + */ + public static String showInputDialog(Component parentComponent, + Object message, Object initialSelectionValue) + { + + // AnnotationPanel + + return isInteractiveMode() + ? JOptionPane.showInputDialog(parentComponent, message, + initialSelectionValue) + : getMockResponse().toString(); + } /** * @@ -679,16 +719,14 @@ public class JvOptionPane extends JOptionPane { switch (messageType) { - default: - case JvOptionPane.INFORMATION_MESSAGE: - prefix = "Note: "; - break; case JvOptionPane.WARNING_MESSAGE: prefix = "WARNING! "; break; case JvOptionPane.ERROR_MESSAGE: - prefix = "ERRROR! "; + prefix = "ERROR! "; break; + default: + prefix = "Note: "; } } return prefix; @@ -775,7 +813,6 @@ public class JvOptionPane extends JOptionPane { parent = parentComponent; } - ; ourOptions = Arrays.asList(options); int response; @@ -800,10 +837,10 @@ public class JvOptionPane extends JOptionPane } @Override - public JvOptionPane response(RunResponse action) + public JvOptionPane addResponse(RunResponse action) { - runner.response(action); + runner.addResponse(action); return this; }