samples/trycatchredo/src/org/apidesign/exceptions/trycatchredo/api/IOManager.java
1 package org.apidesign.exceptions.trycatchredo.api;
4 import javax.swing.Action;
5 import javax.swing.JDialog;
6 import javax.swing.JOptionPane;
10 * @author Jaroslav Tulach <jtulach@netbeans.org>
12 public final class IOManager {
16 /** Action that can store a text to given URL.
18 * @param where the url to upload the text to
19 * @param what the text to upload
20 * @return action that can be invoked anytime to save the content
22 public static Action createSaveAction(URL where, CharSequence what) {
24 return new SaveAction(where, what);
26 return new SaveActionWithQuery(where, what);
31 // Support for executing mock objects in tests
35 static Object setVisibleOption;
36 static void setVisible(JDialog d, JOptionPane p) {
37 if (setVisibleOption == null) {
41 p.setValue(setVisibleOption);