public PDBFTSPanel(SequenceFetcher seqFetcher)
{
+ pageLimit = PDBFTSRestClient.getInstance().getDefaultResponsePageSize();
this.seqFetcher = seqFetcher;
this.progressIdicator = (seqFetcher == null) ? null : seqFetcher
.getProgressIndicator();
@Override
- public void searchAction()
+ public void searchAction(boolean isFreshSearch)
{
+ if (isFreshSearch)
+ {
+ offSet = 0;
+ }
new Thread()
{
@Override
request.setResponseSize(100);
request.setFieldToSearchBy("(" + searchTarget + ":");
request.setSearchTerm(searchTerm + ")");
+ request.setOffSet(offSet);
request.setWantedFields(wantedFields);
FTSRestClientI pdbRestCleint = PDBFTSRestClient.getInstance();
FTSRestResponse resultList;
}
long endTime = System.currentTimeMillis();
- int resultSetCount = resultList.getNumberOfItemsFound();
- String result = (resultSetCount > 1) ? MessageManager
+ totalResultSetCount = resultList.getNumberOfItemsFound();
+ resultSetCount = resultList.getSearchSummary() == null ? 0
+ : resultList.getSearchSummary().size();
+ String result = (resultSetCount > 0) ? MessageManager
.getString("label.results") : MessageManager
.getString("label.result");
- updateSearchFrameTitle(defaultFTSFrameTitle + " - "
- + resultSetCount + " " + result + " ("
- + (endTime - startTime) + " milli secs)");
+
+ if (isPaginationEnabled() && resultSetCount > 0)
+ {
+ updateSearchFrameTitle(defaultFTSFrameTitle + " - " + result
+ + " "
+ + totalNumberformatter.format((Number) (offSet + 1))
+ + " to "
+ + totalNumberformatter
+ .format((Number) (offSet + resultSetCount))
+ + " of "
+ + totalNumberformatter
+ .format((Number) totalResultSetCount)
+ + " " + " (" + (endTime - startTime) + " milli secs)");
+ }
+ else
+ {
+ updateSearchFrameTitle(defaultFTSFrameTitle + " - "
+ + resultSetCount + " " + result + " ("
+ + (endTime - startTime) + " milli secs)");
+ }
+
setSearchInProgress(false);
+ refreshPaginatorState();
+ updateSummaryTableSelections();
}
}
}.start();
false);
} catch (Exception e)
{
- // TODO Auto-generated catch block
e.printStackTrace();
}
int[] selectedRows = getResultTable().getSelectedRows();
+ String searchTerm = txt_search.getText();
for (int summaryRow : selectedRows)
{
String idStr = getResultTable().getValueAt(summaryRow,
primaryKeyColIndex)
.toString();
- String searchTerm = txt_search.getText();
+ selectedIdsSet.add(getPDBIdwithSpecifiedChain(idStr, searchTerm));
+ }
+
+ for (String idStr : paginatorCart)
+ {
selectedIdsSet.add(getPDBIdwithSpecifiedChain(idStr, searchTerm));
}
return pdbIdWithChainCode;
}
-
-
@Override
public FTSRestClientI getFTSRestClient()
{
return ftsFrameTitle;
}
-
- @Override
- public void prevPageAction()
- {
- // TODO pagination not yet implemented for PDB FTS
-
- }
-
- @Override
- public void nextPageAction()
- {
- // TODO pagination not yet implemented for PDB FTS
-
- }
-
@Override
public boolean isPaginationEnabled()
{
- return false;
+ return true;
}
}