2003/09/24 07:33:32
[org.ibex.core.git] / src / org / xwt / Platform.java
index accf069..9216dcb 100644 (file)
@@ -229,6 +229,15 @@ public class Platform {
         }
     }
 
+    /** default implementation is Eric Albert's BrowserLauncher.java */
+    protected void _newBrowserWindow(String url) {
+        try {
+            edu.stanford.ejalbert.BrowserLauncher.openURL(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 +258,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 +275,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);