refresh table method
[jalview.git] / src / jalview / util / UrlLink.java
index 21dee38..00e33b2 100644 (file)
@@ -1,3 +1,21 @@
+/*\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)\r
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * \r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
+ */\r
 package jalview.util;\r
 \r
 import java.util.Vector;\r
@@ -11,6 +29,7 @@ public class UrlLink
    * strings and replace the result in the URL. Regex's operate on the whole ID\r
    * string given to the matchURL method, if no regex is supplied, then only\r
    * text following the first pipe symbol will be susbstituted.\r
+   * Usage documentation todo.\r
    */\r
   private String url_suffix, url_prefix, target, label, regexReplace;\r
 \r
@@ -99,7 +118,7 @@ public class UrlLink
       label = link.substring(0, sep = link.lastIndexOf("|"));\r
       url_prefix = link.substring(sep + 1);\r
       regexReplace = null; // implies we trim any prefix if necessary //\r
-                            // regexReplace=".*\\|?(.*)";\r
+      // regexReplace=".*\\|?(.*)";\r
       url_suffix = null;\r
     }\r
   }\r
@@ -153,8 +172,8 @@ public class UrlLink
   }\r
 \r
   /**\r
-   * \r
-   * @return true if URL string could not be parsed properly.\r
+   * Check if URL string was parsed properly.\r
+   * @return boolean - if false then <code>getInvalidMessage</code> returns an error message\r
    */\r
   public boolean isValid()\r
   {\r
@@ -326,7 +345,7 @@ public class UrlLink
      * //"123123312", "123123 ABCDE foo", "PFAM:PF23943",\r
      */\r
     "Label:gi|9234|pdb|102L|A" };\r
-\r
+    // TODO: test the setLabel method.\r
     for (int i = 0; i < links.length; i++)\r
     {\r
       UrlLink ul = new UrlLink(links[i]);\r
@@ -366,4 +385,9 @@ public class UrlLink
     // TODO Auto-generated method stub\r
     return dynamic;\r
   }\r
+\r
+  public void setLabel(String newlabel)\r
+  {\r
+    this.label = newlabel;\r
+  }\r
 }\r