+ public void openJalviewHelpUrl()\r
+ {\r
+ String helpUrl=getParameter("jalviewhelpurl");\r
+ if (helpUrl==null || helpUrl.trim().length()<5)\r
+ {\r
+ helpUrl="http://www.jalview.org/help.html";\r
+ }\r
+ showURL(helpUrl, "HELP"); \r
+ }\r
+ \r
+\r
+ /**\r
+ * open a URL in the browser - resolving it according to relative refs and coping with javascript: protocol if necessary.\r
+ * @param url\r
+ * @param target\r
+ */\r
+ public void showURL(String url, String target)\r
+ {\r
+ try\r
+ {\r
+ if (url.indexOf(":") == -1)\r
+ {\r
+ // TODO: verify (Bas Vroling bug) prepend codebase or server URL to\r
+ // form valid URL\r
+ // Should really use docbase, not codebase.\r
+ URL base = getDefaultParameter("resolvetocodebase", false) ? getDocumentBase() : getCodeBase();\r
+ String codebase = base.toString();\r
+ if (url.indexOf("/") == 0)\r
+ {\r
+ url = codebase.substring(0, codebase.length()\r
+ - base.getFile().length())\r
+ + url;\r
+ }\r
+ else\r
+ {\r
+ url = base + url;\r
+ }\r
+ if (debug) {\r
+ System.err.println("Show url (prepended "+codebase+" - toggle resolvetocodebase if code/docbase resolution is wrong): " + url);\r
+ }\r
+ }\r
+ else\r
+ {\r
+ if (debug) {\r
+ System.err.println("Show url: " + url);\r
+ }\r
+ }\r
+ if (url.indexOf("javascript:") == 0)\r
+ {\r
+ // no target for the javascript context\r
+ getAppletContext().showDocument(\r
+ new java.net.URL(url));\r
+ }\r
+ else\r
+ {\r
+ getAppletContext().showDocument(\r
+ new java.net.URL(url), target);\r
+ }\r
+ } catch (Exception ex)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
+ }\r
+\r