From: tcofoegbu Date: Wed, 27 Apr 2016 15:36:20 +0000 (+0100) Subject: JAL-1563 Added fix to prevent swing timer from reinitiating search action when jalvie... X-Git-Tag: Release_2_10_0~243 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b914c596c26d2a68cade986c3aca6acb8e3e0f5c;p=jalview.git JAL-1563 Added fix to prevent swing timer from reinitiating search action when jalview gains focus on the FTS interface --- diff --git a/src/jalview/fts/core/GFTSPanel.java b/src/jalview/fts/core/GFTSPanel.java index cae271d..0b23503 100644 --- a/src/jalview/fts/core/GFTSPanel.java +++ b/src/jalview/fts/core/GFTSPanel.java @@ -96,6 +96,8 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI protected Collection wantedFields; + private String lastSearchTerm = ""; + private JTable tbl_summary = new JTable() { @Override @@ -364,7 +366,11 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI @Override public void actionPerformed(ActionEvent e) { - searchAction(); + if (!getTypedText().equalsIgnoreCase(lastSearchTerm)) + { + searchAction(); + lastSearchTerm = getTypedText(); + } } }, false); txt_search.getDocument().addDocumentListener(listener);