From: jprocter Date: Fri, 15 Aug 2008 10:01:47 +0000 (+0000) Subject: allow '|' in regex for URL links to be recovered from properties file properly X-Git-Tag: Release_2_4~24 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9251be6d459585e39e85310336b89f3c8834837b;p=jalview.git allow '|' in regex for URL links to be recovered from properties file properly --- diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index b16cf50..7226283 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -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)