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.
24 import java.util.List;
25 import java.util.Vector;
28 * Methods for providing consistent access to up-to-date URLs
33 public interface UrlProviderI
37 * Default sequence URL link label for EMBL-EBI search
39 public static final String DEFAULT_LABEL = "EMBL-EBI Search";
42 * Default sequence URL link string for EMBL-EBI search
44 public static final String DEFAULT_STRING = DEFAULT_LABEL
45 + "|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$";
48 * Location of file for identifiers.org download
50 public static final String ID_ORG_FILE = System.getProperty("user.home")
51 + File.separatorChar + ".jalview_identifiers";
54 * Get names and urls in as strings for display
57 Vector<String> getLinksForDisplay();
60 * Get names and urls as strings for display
63 List<UrlLinkDisplay> getLinksForTable();
66 * Set names and urls from display settings
68 void setUrlData(List<UrlLinkDisplay> links);
71 * Get the id of the default URL
73 * @return id of the default URL
75 String getDefaultUrl();
78 * Get the link for the default URL
80 * @seqid sequence id for which to build link
81 * @return link for the default URL
83 String getDefaultUrl(String seqid);
86 * Get the target of thelink for the default URL
88 * @seqid sequence id for which to build link
89 * @return target of link for the default URL
91 String getDefaultTarget(String seqid);
97 * the id of the URL to set as default
98 * @return true if setting was successful, false otherwise
100 boolean setDefaultUrl(String id);
103 * Write out all URLs as a string suitable for serialising
105 * @return string representation of available URLs
107 String writeUrlsAsString();
110 * Set URL links from pair of collections
115 void setUrlLinks(Vector<String> names, Vector<String> urls)
116 throws IllegalArgumentException;
119 * Choose the default URL in the event of the selected default being
122 * @return id of chosen default url
124 String chooseDefaultUrl();
127 * Determine if id is for a user-defined URL
129 boolean isUserEntry(String id);