Class WebBrowser

java.lang.Object
ucar.unidata.idv.control.WebBrowser

public final class WebBrowser extends Object
A simple utility class for opening a web browser to a given link.
  • Method Details

    • browse

      public static void browse(String url)
      Attempts to use the system default browser to visit url. Tries looking for and executing any browser specified by the IDV property "idv.browser.path".

      If the property wasn't given or there was an error, try the new (as of Java 1.6) way of opening a browser.

      If the previous attempts failed (or we're in 1.5), we finally try some more primitive measures.

      Note: if you are trying to use this method with a JTextPane you may need to turn off editing via JTextComponent.setEditable(boolean).

      Parameters:
      url - URL to visit.
      See Also:
      • tryUserSpecifiedBrowser(String)
      • openNewStyle(String)
      • openOldStyle(String)
    • useBrowserForUrl

      public static boolean useBrowserForUrl(String url)
      Test whether or not a given URL should be opened in a web browser.
      Parameters:
      url - URL to test. Cannot be null.
      Returns:
      true if url begins with either "http:" or "https:".
    • main

      public static void main(String[] args)