2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import java.util.List;
24 import java.util.Vector;
25 import java.util.regex.Pattern;
28 * Leaf node of UrlProvider composite
34 public class UrlProviderImpl implements UrlProviderI
36 private static final Pattern MIRIAM_PATTERN = Pattern
37 .compile("^MIR:\\d{8}$");
38 protected String defaultUrl;
41 public Vector<String> getLinksForDisplay()
43 // TODO Auto-generated method stub
48 public String getDefaultUrl()
54 public String getDefaultUrl(String seqid)
56 // TODO Auto-generated method stub
61 public String getDefaultTarget(String seqid)
63 // TODO Auto-generated method stub
68 public boolean setDefaultUrl(String id)
70 // TODO Auto-generated method stub
75 public String writeUrlsAsString()
77 // TODO Auto-generated method stub
82 public void setUrlLinks(Vector<String> names, Vector<String> urls)
84 // TODO Auto-generated method stub
89 public String chooseDefaultUrl()
91 // TODO Auto-generated method stub
96 public List<UrlLinkDisplay> getLinksForTable()
102 public void setUrlData(List<UrlLinkDisplay> links)
104 // deliberately left empty
107 protected boolean isMiriamId(String id)
109 return MIRIAM_PATTERN.matcher(id).matches();
113 public boolean isUserEntry(String id)
115 return !isMiriamId(id);