+ public void searchAction(boolean isFreshSearch)
+ {
+ if (isFreshSearch)
+ {
+ offSet = 0;
+ }
+ new Thread()
+ {
+ @Override
+ public void run()
+ {
+ ftsFrameTitle = defaultFTSFrameTitle;
+ reset();
+ if (getTypedText().length() > 0)
+ {
+ setSearchInProgress(true);
+ long startTime = System.currentTimeMillis();
+
+ String searchTarget = ((FTSDataColumnI) cmb_searchTarget
+ .getSelectedItem()).getAltCode();
+
+ wantedFields = UniProtFTSRestClient.getInstance()
+ .getAllDefaulDisplayedDataColumns();
+ String searchTerm = decodeSearchTerm(txt_search.getText(),
+ searchTarget);
+
+ FTSRestRequest request = new FTSRestRequest();
+ request.setFieldToSearchBy(searchTarget);
+ request.setSearchTerm(searchTerm);
+ request.setOffSet(offSet);
+ request.setWantedFields(wantedFields);
+ FTSRestClientI uniProtRestCleint = UniProtFTSRestClient
+ .getInstance();
+ FTSRestResponse resultList;
+ try
+ {
+ resultList = uniProtRestCleint.executeRequest(request);
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ setErrorMessage(e.getMessage());
+ checkForErrors();
+ return;
+ }
+
+ if (resultList.getSearchSummary() != null
+ && resultList.getSearchSummary().size() > 0)
+ {
+ getResultTable().setModel(
+ FTSRestResponse.getTableModel(request,
+ resultList.getSearchSummary()));
+ FTSRestResponse.configureTableColumn(getResultTable(),
+ wantedFields);
+ getResultTable().setVisible(true);
+ }
+
+ long endTime = System.currentTimeMillis();
+ totalResultSetCount = resultList.getNumberOfItemsFound();
+ resultSetCount = resultList.getSearchSummary() == null ? 0
+ : resultList.getSearchSummary().size();
+ String result = (resultSetCount > 0) ? MessageManager
+ .getString("label.results") : MessageManager
+ .getString("label.result");
+ if (isPaginationEnabled() && resultSetCount > 0)
+ {
+ updateSearchFrameTitle(defaultFTSFrameTitle + " - " + result
+ + " " + (offSet + 1) + " to "
+ + (offSet + resultSetCount) + " of "
+ + totalResultSetCount
+ + " " + " (" + (endTime - startTime) + " milli secs)");
+ }
+ else
+ {
+ updateSearchFrameTitle(defaultFTSFrameTitle + " - "
+ + resultSetCount + " " + result + " ("
+ + (endTime - startTime) + " milli secs)");
+ }
+ setSearchInProgress(false);
+ refreshPaginatorState();
+ updateSummaryTableSelections();
+ }
+ }
+ }.start();
+
+ }
+
+ public String decodeSearchTerm(String enteredText, String targetField)