JAL-1563 JAL-2091 Added generic pagination for FTS Service, pagination for PDB FTS...
[jalview.git] / src / jalview / fts / api / GFTSPanelI.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
22 package jalview.fts.api;
23
24 import javax.swing.JTable;
25
26 /**
27  * 
28  * @author tcnofoegbu
29  *
30  */
31 public interface GFTSPanelI
32 {
33
34   /**
35    * Action performed when a text is entered in the search field.
36    * 
37    * @param isFreshSearch
38    *          if true a fresh search is executed else a pagination search is
39    *          executed
40    */
41   public void searchAction(boolean isFreshSearch);
42
43   /**
44    * Action performed when search results are selected and the 'ok' button is
45    * pressed.
46    */
47   public void okAction();
48
49   /**
50    * Return the entered text
51    * 
52    * @return the entered text
53    */
54   public String getTypedText();
55
56   /**
57    * The JTable for presenting the query result
58    * 
59    * @return JTable
60    */
61   public JTable getResultTable();
62
63   /**
64    * Return the title to display on the search interface main panel
65    * 
66    * @return String - the title
67    */
68   public String getFTSFrameTitle();
69
70   /**
71    * Return a singleton instance of FTSRestClientI
72    * 
73    * @return FTSRestClientI
74    */
75   public FTSRestClientI getFTSRestClient();
76
77   /**
78    * Set error message when one occurs
79    * 
80    * @param message
81    *          the error message to set
82    */
83   public void setErrorMessage(String message);
84
85   /**
86    * Updates the title displayed on the search interface's main panel
87    * 
88    * @param newTitle
89    */
90   public void updateSearchFrameTitle(String newTitle);
91
92   /**
93    * Controls the progress spinner, set to 'true' while search operation is in
94    * progress and 'false' after it completes
95    * 
96    * @param isSearchInProgress
97    */
98   public void setSearchInProgress(Boolean isSearchInProgress);
99
100   /**
101    * Action performed when previous page (<<) button is pressed pressed.
102    */
103   public void prevPageAction();
104
105   /**
106    * Action performed when next page (>>) button is pressed pressed.
107    */
108   public void nextPageAction();
109
110   /**
111    * Checks if the current service's search result is paginate-able
112    * 
113    * @return true means the service provides paginated results
114    */
115   public boolean isPaginationEnabled();
116
117   /**
118    * Updates the 'enabled' state for the previous page button
119    * 
120    * @param isEnabled
121    */
122   public void setPrevPageButtonEnabled(boolean isEnabled);
123
124   /**
125    * Updates the 'enabled' state for the next page button
126    * 
127    * @param isEnabled
128    */
129   public void setNextPageButtonEnabled(boolean isEnabled);
130 }