Class BrowserControl

java.lang.Object
org.gvsig.utils.BrowserControl

public class BrowserControl extends Object

A simple, static class to display a URL in the system browser.

Under Unix systems, it will open one of the browser set through the setBrowserCommand(String). The argument of this method must be a fully qualified command or one of the commands returned by getSupportedBrowsers().
By default, the browser is Firefox, which is included in the list of supported browsers.

Under Windows, this will bring up the default browser under windows, usually either Netscape or Microsoft IE. The default browser is determined by the OS so no config is necessary.
This has been tested under Windows 95/98/NT/XP.

Notice that you must include the url type -- either "http://" or "file://".

Under Mac, the usability of this class is pending of test. So probably it does not work

Examples: BrowserControl.displayURL("http://www.javaworld.com") BrowserControl.displayURL("file://c:\\docs\\index.html") BrowserContorl.displayURL("file:///user/joe/index.html");
Author:
jaume dominguez faus - jaume.dominguez@iver.es
  • Field Details

  • Constructor Details

    • BrowserControl

      public BrowserControl()
  • Method Details

    • displayURL

      public static void displayURL(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
    • setBrowserCommand

      public static void setBrowserCommand(String browserCommand)
    • getSupportedBrowsers

      public static ArrayList getSupportedBrowsers()
      Returns a list of supported browsers.
      Returns: