From a3499f1eaaef8cc03aac19a28f960acd0fd70a04 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Fri, 29 Apr 2016 16:50:02 +0100 Subject: [PATCH] JAL-1563 house keeping/updated API doc for new method added for FTS pagination --- src/jalview/fts/api/GFTSPanelI.java | 25 ++++++++++++++++++++ src/jalview/fts/core/GFTSPanel.java | 12 ++++++++++ .../fts/service/uniprot/UniprotFTSPanel.java | 8 +++---- 3 files changed, 41 insertions(+), 4 deletions(-) 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); } } -- 1.7.10.2