From 3cd147b2caead40e9abea8c58eb48f6a47975378 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Tue, 11 Apr 2017 13:14:33 +0100 Subject: [PATCH] JAL-1648 minor house keeping --- src/jalview/fts/core/GFTSPanel.java | 12 ++++++++---- src/jalview/fts/service/pdb/PDBFTSPanel.java | 2 +- src/jalview/fts/service/uniprot/UniprotFTSPanel.java | 8 +++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/jalview/fts/core/GFTSPanel.java b/src/jalview/fts/core/GFTSPanel.java index 1c20d1d..918b3c9 100644 --- a/src/jalview/fts/core/GFTSPanel.java +++ b/src/jalview/fts/core/GFTSPanel.java @@ -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 diff --git a/src/jalview/fts/service/pdb/PDBFTSPanel.java b/src/jalview/fts/service/pdb/PDBFTSPanel.java index 23ff8f3..c1e11b3 100644 --- a/src/jalview/fts/service/pdb/PDBFTSPanel.java +++ b/src/jalview/fts/service/pdb/PDBFTSPanel.java @@ -143,8 +143,8 @@ public class PDBFTSPanel extends GFTSPanel setSearchInProgress(false); refreshPaginatorState(); updateSummaryTableSelections(); + updateCache(); } - updateCache(); } }.start(); } diff --git a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java index 88442de..08464c7 100644 --- a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java +++ b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java @@ -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(); -- 1.7.10.2