added URL display for parameters/options and debugged parameter set switching
[jalview.git] / src / jalview / gui / Desktop.java
index bf0d052..53fa463 100755 (executable)
@@ -2175,4 +2175,29 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     }
   }
 
+  /**
+   * start a thread to open a URL in the configured browser. Pops up a warning dialog to the user if there is an exception when calling out to the browser to open the URL.
+   * @param url
+   */
+  public static void showUrl(final String url)
+  {
+    new Thread(new Runnable() {
+      public void run() {
+        try {
+          jalview.util.BrowserLauncher.openURL(url);
+        } catch (Exception ex)
+        {    
+          JOptionPane
+                  .showInternalMessageDialog(
+                          Desktop.desktop,
+                          "Unixers: Couldn't find default web browser."
+                                  + "\nAdd the full path to your browser in Preferences.",
+                          "Web browser not found", JOptionPane.WARNING_MESSAGE);
+
+          ex.printStackTrace();
+        }
+      }
+    }).start();    
+  }
+
 }