prefuse.util.ui
Class BrowserLauncher

java.lang.Object
  extended by prefuse.util.ui.BrowserLauncher

public abstract class BrowserLauncher
extends java.lang.Object

Browser launcher will open a URL in an external browser on your system. (e.g. Internet Explorer or Netscape). If your browser is already open, a new browser window should be created without starting any new processes.

On Windows systems the system's default browser will be used. On UNIX and other platforms the browser defaults to Netscape. For this default behavior to work, the command 'netscape' must be on your path.

This class was inspired by an article at www.javaworld.com by Steven Spencer. The article is available at http://www.javaworld.com/javaworld/javatips/jw-javatip66.html .

Author:
Steven Spencer, jeffrey heer (adapted original author's code)

Constructor Summary
BrowserLauncher()
           
 
Method Summary
static boolean isWindowsPlatform()
          Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.
static void main(java.lang.String[] argv)
          Opens the URL specified on the command line in the system browser.
static void showDocument(java.lang.String url)
          Display a file in the system browser.
static void showDocument(java.net.URL url)
          Display a file in the system browser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserLauncher

public BrowserLauncher()
Method Detail

showDocument

public static void showDocument(java.net.URL url)
Display a file in the system browser.

Parameters:
url - the file's url

showDocument

public static void showDocument(java.lang.String url)
Display a file in the system browser. If you want to display a file, you must include the absolute path name.

Parameters:
url - the file's url (the url must start with either "http://" or "file://").

isWindowsPlatform

public static boolean isWindowsPlatform()
Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.

Returns:
true if this application is running under a Windows OS

main

public static void main(java.lang.String[] argv)
Opens the URL specified on the command line in the system browser.

Parameters:
argv - argument array. Only the first argument is considered.


Copyright © 2007 Regents of the University of California