X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FJvOptionPane.java;h=89899e2532bf50f5cbde66ae708b6aa216ff0637;hb=13391b836bdc59c53cd8e8aba8d449629307d9b7;hp=4e443e7a4ff30e052e2aa304d320154b4f7426ff;hpb=adf7ce928faa801045db27cb7fb998821b5eb5f1;p=jalview.git diff --git a/src/jalview/gui/JvOptionPane.java b/src/jalview/gui/JvOptionPane.java index 4e443e7..89899e2 100644 --- a/src/jalview/gui/JvOptionPane.java +++ b/src/jalview/gui/JvOptionPane.java @@ -34,6 +34,7 @@ import java.util.List; import javax.swing.Icon; import javax.swing.JOptionPane; +import javax.swing.JPanel; public class JvOptionPane extends JOptionPane implements DialogRunnerI, PropertyChangeListener @@ -759,6 +760,45 @@ public class JvOptionPane extends JOptionPane } + public void showInternalDialog(JPanel mainPanel, String title, + int yesNoCancelOption, int questionMessage, Icon icon, + Object[] options, String initresponse) + { + if (!isInteractiveMode()) + { + runner.firstRun((int) getMockResponse()); + } + Component parent; + /** + * @j2sNative parent = this; + */ + { + parent = parentComponent; + } + ; + ourOptions = Arrays.asList(options); + + int response; + if (parent!=this) { + + response = JOptionPane.showInternalOptionDialog(parent, mainPanel, + title, yesNoCancelOption, questionMessage, icon, options, + initresponse); + } + else + { + response = JOptionPane.showOptionDialog(parent, mainPanel, title, + yesNoCancelOption, questionMessage, icon, options, + initresponse); + } + /** + * @j2sNative + */ + { + runner.firstRun(response); + } + + } @Override public JvOptionPane response(RunResponse action) { @@ -788,4 +828,5 @@ public class JvOptionPane extends JOptionPane } } + }