JAL-1563 house keeping/updated API doc for new method added for FTS pagination merge/JAL-1563_uniprot-free-text-search
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 29 Apr 2016 15:50:02 +0000 (16:50 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 29 Apr 2016 15:50:02 +0000 (16:50 +0100)
src/jalview/fts/api/GFTSPanelI.java
src/jalview/fts/core/GFTSPanel.java
src/jalview/fts/service/uniprot/UniprotFTSPanel.java

index 07ae5a1..16bf404 100644 (file)
@@ -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);
 }
index c9ee297..02a313b 100644 (file)
@@ -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);
index c40e1e8..3681a23 100644 (file)
@@ -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);
     }
   }