allow '|' in regex for URL links to be recovered from properties file properly
authorjprocter <Jim Procter>
Fri, 15 Aug 2008 10:01:47 +0000 (10:01 +0000)
committerjprocter <Jim Procter>
Fri, 15 Aug 2008 10:01:47 +0000 (10:01 +0000)
src/jalview/gui/Preferences.java

index b16cf50..7226283 100755 (executable)
@@ -38,7 +38,7 @@ import jalview.schemes.*;
 public class Preferences
     extends GPreferences
 {
-  /** Holds name and link separated with | character. Sequence ID must be $SEQUENCE_ID$ */
+  /** Holds name and link separated with | character. Sequence ID must be $SEQUENCE_ID$ or $SEQUENCE_ID=/.possible | chars ./=$ */
   public static Vector sequenceURLLinks;
   static
   {
@@ -51,7 +51,15 @@ public class Preferences
       StringTokenizer st = new StringTokenizer(string, "|");
       while (st.hasMoreElements())
       {
-        sequenceURLLinks.addElement(st.nextToken() + "|" + st.nextToken());
+        String name=st.nextToken();
+        String url= st.nextToken();
+        // check for '|' within a regex
+        int rxstart = url.indexOf("$SEQUENCE_ID$");
+        while (rxstart==-1 && url.indexOf("/=$")==-1)
+        {
+          url = url + "|" + st.nextToken();
+        }
+        sequenceURLLinks.addElement(name + "|" + url);
       }
     }
     catch (Exception ex)