From: tcofoegbu Date: Fri, 29 Apr 2016 15:50:02 +0000 (+0100) Subject: JAL-1563 house keeping/updated API doc for new method added for FTS pagination X-Git-Tag: Release_2_10_0~236 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmerge%2FJAL-1563_uniprot-free-text-search;p=jalview.git JAL-1563 house keeping/updated API doc for new method added for FTS pagination --- diff --git a/src/jalview/fts/api/GFTSPanelI.java b/src/jalview/fts/api/GFTSPanelI.java index 07ae5a1..16bf404 100644 --- a/src/jalview/fts/api/GFTSPanelI.java +++ b/src/jalview/fts/api/GFTSPanelI.java @@ -93,9 +93,34 @@ public interface GFTSPanelI */ public void setSearchInProgress(Boolean isSearchInProgress); + /** + * Action performed when previous page (<<) button is pressed pressed. + */ public void prevPageAction(); + /** + * Action performed when next page (>>) button is pressed pressed. + */ public void nextPageAction(); + /** + * Checks if the current service's search result is paginate-able + * + * @return true means the service provides paginated results + */ public boolean isPaginationEnabled(); + + /** + * Updates the 'enabled' state for the previous page button + * + * @param isEnabled + */ + public void setPrevPageButtonEnabled(boolean isEnabled); + + /** + * Updates the 'enabled' state for the next page button + * + * @param isEnabled + */ + public void setNextPageButtonEnabled(boolean isEnabled); } diff --git a/src/jalview/fts/core/GFTSPanel.java b/src/jalview/fts/core/GFTSPanel.java index c9ee297..02a313b 100644 --- a/src/jalview/fts/core/GFTSPanel.java +++ b/src/jalview/fts/core/GFTSPanel.java @@ -763,6 +763,18 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI } @Override + public void setPrevPageButtonEnabled(boolean isEnabled) + { + btn_prev_page.setEnabled(isEnabled); + } + + @Override + public void setNextPageButtonEnabled(boolean isEnabled) + { + btn_next_page.setEnabled(isEnabled); + } + + @Override public void setErrorMessage(String message) { errorWarning.append(message); diff --git a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java index c40e1e8..3681a23 100644 --- a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java +++ b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java @@ -144,15 +144,15 @@ public class UniprotFTSPanel extends GFTSPanel // System.out.println("resultSet count : " + resultSetCount); // System.out.println("offSet : " + offSet); // System.out.println("page limit : " + pageLimit); - btn_prev_page.setEnabled(false); - btn_next_page.setEnabled(false); + setPrevPageButtonEnabled(false); + setNextPageButtonEnabled(false); if (resultSetCount >= pageLimit) { - btn_next_page.setEnabled(true); + setNextPageButtonEnabled(true); } if (offSet >= pageLimit) { - btn_prev_page.setEnabled(true); + setPrevPageButtonEnabled(true); } }