1.1 --- a/rt/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Launcher.java Thu Feb 28 21:00:39 2013 +0100
1.2 +++ b/rt/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Launcher.java Wed Mar 13 16:20:03 2013 +0100
1.3 @@ -20,6 +20,7 @@
1.4 import java.io.Closeable;
1.5 import java.io.File;
1.6 import java.io.IOException;
1.7 +import java.lang.reflect.Method;
1.8 import java.net.URLClassLoader;
1.9 import org.apidesign.vm4brwsr.Bck2Brwsr;
1.10
1.11 @@ -70,14 +71,21 @@
1.12 return l;
1.13 }
1.14
1.15 - /** Creates launcher that is using external browser.
1.16 + /** Creates launcher that is using external browser. Value of <code>cmd</code>
1.17 + * may be <code>"fx"</code> to indicate one wants to use JavaFX's WebView
1.18 + * instead of command line browser.
1.19 *
1.20 * @param cmd <code>null</code> to use <code>java.awt.Desktop</code> to show the launcher
1.21 * or a string to execute in an external process (with a parameter to the URL)
1.22 * @return launcher executing in external browser.
1.23 */
1.24 public static Launcher createBrowser(String cmd) {
1.25 - final Bck2BrwsrLauncher l = new Bck2BrwsrLauncher(cmd);
1.26 + final Bck2BrwsrLauncher l;
1.27 + if ("fx".equals(cmd)) {
1.28 + l = new WebViewLauncher();
1.29 + } else {
1.30 + l = new Bck2BrwsrLauncher(cmd);
1.31 + }
1.32 l.addClassLoader(Bck2Brwsr.class.getClassLoader());
1.33 l.setTimeout(180000);
1.34 return l;