2002/04/28 04:36:08
[org.ibex.core.git] / src / org / xwt / Platform.java
index 173ae0c..710df27 100644 (file)
@@ -156,6 +156,11 @@ public class Platform {
 
     protected boolean _needsAutoClick() { return false; }
 
+    protected void _newBrowserWindow(String url) {
+        if (Log.on) Log.log(this, "Platform " + platform.getClass().getName() + " cannot open browser windows");
+        return;
+    }
+
     // Static methods -- thunk to the instance /////////////////////////////////////////////////////////////////////////
 
     /** if true, org.xwt.Surface should generate Click messages automatically when a Release happens after a Press and the mouse has not moved much */
@@ -212,6 +217,15 @@ public class Platform {
     /** creates and returns a picture */
     public static Picture createPicture(ImageDecoder i) { return platform._createPicture(i.getData(), i.getWidth(), i.getHeight()); }
 
+    /** creates and returns a picture */
+    public static void newBrowserWindow(String url) {
+        if (!(url.startsWith("https://") || url.startsWith("http://") || url.startsWith("ftp://") || url.startsWith("mailto:"))) {
+            if (Log.on) Log.log(Platform.class, "xwt.newBrowserWindow() only supports http and https urls");
+            return;
+        }
+        platform._newBrowserWindow(url);
+    }
+
     /** quits XWT */
     public static void exit() {
         Log.log(Platform.class, "exiting via Platform.exit()");