remove duplicate host URLs in service list when not indexing services by host
[jalview.git] / src / jalview / gui / Desktop.java
index bf0d052..8531e04 100755 (executable)
@@ -19,6 +19,7 @@ package jalview.gui;
 
 import jalview.bin.Cache;
 import jalview.io.*;
+import jalview.ws.params.ParamManager;
 
 import java.awt.*;
 import java.awt.datatransfer.*;
@@ -2175,4 +2176,39 @@ 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();    
+  }
+
+  public static WsParamSetManager wsparamManager = null;
+  public static ParamManager getUserParameterStore()
+  {
+    if (wsparamManager==null)
+    {
+      wsparamManager = new WsParamSetManager();
+    }
+    return wsparamManager;
+  }
+
 }