JAL-1648 minor house keeping
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 11 Apr 2017 12:14:33 +0000 (13:14 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 11 Apr 2017 12:14:33 +0000 (13:14 +0100)
src/jalview/fts/core/GFTSPanel.java
src/jalview/fts/service/pdb/PDBFTSPanel.java
src/jalview/fts/service/uniprot/UniprotFTSPanel.java

index 1c20d1d..918b3c9 100644 (file)
@@ -493,7 +493,6 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI, Cacheable
     });
  
 
-
     txt_search.setFont(new java.awt.Font("Verdana", 0, 12));
 
     txt_search.getEditor().getEditorComponent()
@@ -525,11 +524,12 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI, Cacheable
               @Override
               public void actionPerformed(ActionEvent e)
               {
-                if (!getTypedText().equalsIgnoreCase(lastSearchTerm))
+                String typed = getTypedText();
+                if (!typed.equalsIgnoreCase(lastSearchTerm))
                 {
                   searchAction(true);
                   paginatorCart.clear();
-                  lastSearchTerm = getTypedText();
+                  lastSearchTerm = typed;
                 }
               }
             }, false);
@@ -835,8 +835,11 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI, Cacheable
   @Override
   public String getTypedText()
   {
-    return txt_search.getEditor().getItem() == null ? "" : txt_search
+    String typed = txt_search.getEditor().getItem() == null ? ""
+            : txt_search
             .getEditor().getItem().toString().trim();
+    System.out.println("Typed : " + typed);
+    return typed;
   }
 
   @Override
@@ -887,6 +890,7 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI, Cacheable
   {
     lbl_blank.setVisible(!isSearchInProgress);
     lbl_loading.setVisible(isSearchInProgress);
+    txt_search.setEditable(!isSearchInProgress);
   }
 
   @Override
index 23ff8f3..c1e11b3 100644 (file)
@@ -143,8 +143,8 @@ public class PDBFTSPanel extends GFTSPanel
           setSearchInProgress(false);
           refreshPaginatorState();
           updateSummaryTableSelections();
+          updateCache();
         }
-        updateCache();
       }
     }.start();
   }
index 88442de..08464c7 100644 (file)
@@ -74,14 +74,12 @@ public class UniprotFTSPanel extends GFTSPanel
         {
           setSearchInProgress(true);
           long startTime = System.currentTimeMillis();
-
+          searchInput = getTypedText();
           String searchTarget = ((FTSDataColumnI) cmb_searchTarget
                   .getSelectedItem()).getAltCode();
-
           wantedFields = UniProtFTSRestClient.getInstance()
                   .getAllDefaultDisplayedFTSDataColumns();
-          String searchTerm = decodeSearchTerm(getTypedText(),
-                  searchTarget);
+          String searchTerm = decodeSearchTerm(searchInput, searchTarget);
 
           FTSRestRequest request = new FTSRestRequest();
           request.setFieldToSearchBy(searchTarget);
@@ -144,8 +142,8 @@ public class UniprotFTSPanel extends GFTSPanel
           setSearchInProgress(false);
           refreshPaginatorState();
           updateSummaryTableSelections();
+          updateCache();
         }
-        updateCache();
       }
     }.start();