X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FPlatform.java;h=0ca55b9d0be711ca02d2de19f4e0e28d840f4add;hb=73a633c6b568a6b90457199718f22b26b91f441d;hp=accf0691906f3ccdf7a974ebc3318abdb4c07a38;hpb=d1db5780c2fe79cf7acaa71508358d410aec7b96;p=org.ibex.core.git diff --git a/src/org/xwt/Platform.java b/src/org/xwt/Platform.java index accf069..0ca55b9 100644 --- a/src/org/xwt/Platform.java +++ b/src/org/xwt/Platform.java @@ -229,6 +229,17 @@ public class Platform { } } + /** default implementation is Eric Albert's BrowserLauncher.java */ + protected void _newBrowserWindow(String url) { + try { + Class c = Class.forName("edu.stanford.ejalbert.BrowserLauncher"); + Method m = c.getMethod("openURL", new Class[] { String.class }); + m.invoke(null, new String[] { url }); + } catch (Exception e) { + Log.log(this, e); + } + } + /** opens a new browser window */ public static void newBrowserWindow(String url) { if (!(url.startsWith("https://") || url.startsWith("http://") || url.startsWith("ftp://") || url.startsWith("mailto:"))) { @@ -249,9 +260,6 @@ public class Platform { if (Log.on) Log.log(Platform.class, "newBrowserWindow, url = " + url); platform._newBrowserWindow(url); } - protected void _newBrowserWindow(String url) { - if (Log.on) Log.log(this, "Platform " + platform.getClass().getName() + " cannot open browser windows"); - } /** used to notify the user of very serious failures; usually used when logging is not working or unavailable */ public static void criticalAbort(String message) { @@ -269,14 +277,12 @@ public class Platform { Object titlebar = b.get("titlebar", true); if (titlebar != null) ret.setTitleBarText(titlebar.toString()); - /* FIXME Object icon = b.get("icon", true); - if (icon != null && !"".equals(icon)) { - Picture pic = ImageDecoder.getPicture(icon.toString()); + if (icon != null && icon instanceof Res) { + Picture pic = Picture.fromRes((Res)icon); if (pic != null) ret.setIcon(pic); else if (Log.on) Log.log(Platform.class, "unable to load icon " + icon); } - */ ret.setLimits(b.minwidth, b.minheight, b.maxwidth, b.maxheight); @@ -306,7 +312,9 @@ public class Platform { return cachedProxyInfo; } - + + public static void running() { platform._running(); } + public void _running() { new Semaphore().block(); } }