JAL-2316 Adjusted unit tests. Tidied UrlLinkProviderI interface.
[jalview.git] / src / jalview / urls / UrlProviderI.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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.
11  *  
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.
16  * 
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.
20  */
21 package jalview.urls;
22
23 import java.util.List;
24 import java.util.Vector;
25
26 /**
27  * Methods for providing consistent access to up-to-date URLs
28  * 
29  * @author $author$
30  * @version $Revision$
31  */
32 public interface UrlProviderI
33 {
34
35   /**
36    * Get names and urls in as strings for display
37    * 
38    */
39   Vector<String> getLinksForMenu();
40
41   /**
42    * Get names and urls as strings for display
43    * 
44    */
45   List<UrlLinkDisplay> getLinksForTable();
46
47   /**
48    * Set names and urls from display settings
49    */
50   void setUrlData(List<UrlLinkDisplay> links);
51
52   /**
53    * Get the link for the default URL
54    * 
55    * @seqid sequence id for which to build link
56    * @return link for the default URL
57    */
58   String getDefaultUrl(String seqid);
59
60   /**
61    * Get the target of thelink for the default URL
62    * 
63    * @seqid sequence id for which to build link
64    * @return target of link for the default URL
65    */
66   String getDefaultTarget(String seqid);
67
68   /**
69    * Set the default URL
70    * 
71    * @param id
72    *          the id of the URL to set as default
73    * @return true if setting was successful, false otherwise
74    */
75   boolean setDefaultUrl(String id);
76
77   /**
78    * Write out all URLs as a string suitable for serialising
79    * 
80    * @return string representation of available URLs
81    */
82   String writeUrlsAsString();
83
84   /**
85    * Choose the default URL in the event of the selected default being
86    * unavailable
87    * 
88    * @return id of chosen default url
89    */
90   String chooseDefaultUrl();
91
92   /**
93    * Determine if id is for a user-defined URL
94    */
95   boolean isUserEntry(String id);
96
97   /**
98    * Get list of column names to display in UI
99    * 
100    * @return column names
101    */
102   List<String> getDisplayColumnNames();
103 }