Revision: 2404
          http://vexi.svn.sourceforge.net/vexi/?rev=2404&view=rev
Author:   mkpg2
Date:     2007-10-01 18:43:57 -0700 (Mon, 01 Oct 2007)

Log Message:
-----------
Fix. EjAlbertBrowserLauncher's methods were being pruned. 

Actually it doesn't need to be accessed dynamically, call it directly from JVM 
Platform instead.

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/plat/JVM.java
    trunk/core/org.vexi.core/src/org/vexi/plat/Platform.java

Modified: trunk/core/org.vexi.core/src/org/vexi/plat/JVM.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/plat/JVM.java 2007-10-02 01:43:50 UTC 
(rev 2403)
+++ trunk/core/org.vexi.core/src/org/vexi/plat/JVM.java 2007-10-02 01:43:57 UTC 
(rev 2404)
@@ -4,7 +4,20 @@
 
 package org.vexi.plat;
 
+import java.io.IOException;
+
+import org.ibex.js.JSExn;
+import org.ibex.util.Log;
+
 /** common superclass for all platforms that run in a "real" JVM */
 public abstract class JVM extends Platform {
-
+    protected void _newBrowserWindow(String url) throws JSExn {
+       try {
+                       org.ibex.util.EjAlbertBrowserLauncher.openURL(url);
+                       return;
+               } catch (IOException e) {
+                       Log.warn(Platform.class, e);
+               }
+       super._newBrowserWindow(url);
+    }
 }

Modified: trunk/core/org.vexi.core/src/org/vexi/plat/Platform.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/plat/Platform.java    2007-10-02 
01:43:50 UTC (rev 2403)
+++ trunk/core/org.vexi.core/src/org/vexi/plat/Platform.java    2007-10-02 
01:43:57 UTC (rev 2404)
@@ -238,24 +238,14 @@
     }
 
     /** default implementation is Eric Albert's BrowserLauncher.java */
-    protected void _newBrowserWindow(String url) {
-        try {
-            //Class c = Class.forName("edu.stanford.ejalbert.BrowserLauncher");
-            Class c = Class.forName("org.ibex.util.EjAlbertBrowserLauncher");
-            Method m = c.getMethod("openURL", new Class[] { String.class });
-            m.invoke(null, new String[] { url });
-        } catch(ClassNotFoundException e){
-               Log.warn(this, "browser launching not available");
-        } catch (Exception e) {
-            Log.warn(this, e);
-        }
+    protected void _newBrowserWindow(String url) throws JSExn{
+       throw new JSExn("browser launching not available");
     }
 
     /** opens a new browser window */
-    public static void newBrowserWindow(String url) {
+    public static void newBrowserWindow(String url) throws JSExn {
         if (!(url.startsWith("https://";) || url.startsWith("http://";) || 
url.startsWith("ftp://";) || url.startsWith("mailto:";))) {
-            Log.info(Platform.class, "vexi.newBrowserWindow() only supports 
http and https urls");
-            return;
+            throw new JSExn("browser launching only supports http,https,ftp 
and mailto:";);
         }
         // check the URL for well-formedness, as a defense against buffer 
overflow attacks
         // FIXME check URL without using URL class
@@ -269,7 +259,7 @@
             Log.info(Platform.class, e);
         }
         */
-        Log.info(Platform.class, "newBrowserWindow, url = " + url);
+        Log.uInfo(Platform.class, "opening browser, url = " + url);
         platform._newBrowserWindow(url);
     }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to