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;
27 * Methods for providing consistent access to up-to-date URLs
32 public interface UrlProviderI
36 * Get names and urls in the UrlProvider as strings for display
39 Vector<String> getLinksForMenu();
42 * Get names and urls as strings for display
45 List<UrlLinkDisplay> getLinksForTable();
48 * Set names and urls from display settings
50 void setUrlData(List<UrlLinkDisplay> links);
53 * Get the link for the default URL
55 * @seqid sequence id for which to build link
56 * @return link for the default URL
58 String getDefaultUrl(String seqid);
61 * Get the default URL id
63 * @return id for default URL
65 String getDefaultUrlId();
68 * Get the target of the link for the default URL
70 * @seqid sequence id for which to build link
71 * @return target of link for the default URL
73 String getDefaultTarget(String seqid);
79 * the id of the URL to set as default
80 * @return true if setting is successful
81 * @throws IllegalArgumentException
82 * if id does not exist as a url in the UrlProvider
84 boolean setDefaultUrl(String id) throws IllegalArgumentException;
87 * Test if UrlProvider contains a url
91 * @return true of UrlProvider contains this id, false otherwise
93 boolean contains(String id);
96 * Write out all URLs as a string suitable for serialising
98 * @return string representation of available URLs
100 String writeUrlsAsString(boolean selected);
103 * Choose the default URL in the event of the selected default being
106 * @return id of chosen default url
108 String chooseDefaultUrl();
111 * Determine if id is for a user-defined URL
113 boolean isUserEntry(String id);