import javax.swing.ImageIcon;
import javax.swing.JButton;
+import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
protected JButton btn_cancel = new JButton();
+ protected JCheckBox btn_autosearch = new JCheckBox();
+
protected JvCacheableInputBox<String> txt_search;
protected SequenceFetcher seqFetcher;
}
});
+ btn_autosearch.setText("");
+ btn_autosearch.setToolTipText(
+ MessageManager.getString("option.enable_disable_autosearch"));
btn_back.setFont(new java.awt.Font("Verdana", 0, 12));
btn_back.setText(MessageManager.getString("action.back"));
btn_back.addActionListener(new java.awt.event.ActionListener()
@Override
public void actionPerformed(ActionEvent e)
{
- String typed = getTypedText();
- if (!typed.equalsIgnoreCase(lastSearchTerm))
+ if (btn_autosearch.isSelected()
+ || txt_search.wasEnterPressed())
{
- searchAction(true);
- paginatorCart.clear();
- lastSearchTerm = typed;
+ performSearchAction();
}
}
}, false);
pnl_results.add(tabbedPane);
pnl_inputs.add(cmb_searchTarget);
pnl_inputs.add(txt_search);
+ pnl_inputs.add(btn_autosearch);
pnl_inputs.add(lbl_loading);
pnl_inputs.add(lbl_warning);
pnl_inputs.add(lbl_blank);
}
+ void performSearchAction()
+ {
+ String typed = getTypedText();
+ if (typed != null && typed.length() > 0
+ && !typed.equalsIgnoreCase(lastSearchTerm))
+ {
+ searchAction(true);
+ paginatorCart.clear();
+ lastSearchTerm = typed;
+ }
+ }
+
public boolean wantedFieldsUpdated()
{
if (previousWantedFields == null)