jtulach@308: package org.apidesign.exceptions.trycatchredo; jtulach@308: jtulach@308: import java.net.URL; jtulach@308: import javax.swing.Action; jtulach@308: jtulach@308: /** jtulach@308: * jtulach@308: * @author Jaroslav Tulach jtulach@308: */ jtulach@308: public final class IOManager { jtulach@310: static boolean old; jtulach@310: jtulach@308: IOManager() { jtulach@308: } jtulach@308: jtulach@310: /** Action that can store a text to given URL. jtulach@310: * jtulach@310: * @param where the url to upload the text to jtulach@310: * @param what the text to upload jtulach@310: * @return action that can be invoked anytime to save the content jtulach@310: */ jtulach@308: public static Action createSaveAction(URL where, CharSequence what) { jtulach@310: if (old) { jtulach@310: return new SaveAction(where, what); jtulach@310: } else { jtulach@310: return new SaveActionWithQuery(where, what); jtulach@310: } jtulach@308: } jtulach@308: }