From 9251be6d459585e39e85310336b89f3c8834837b Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 15 Aug 2008 10:01:47 +0000 Subject: [PATCH] allow '|' in regex for URL links to be recovered from properties file properly --- src/jalview/gui/Preferences.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) -- 1.7.10.2