private static String defaultFTSFrameTitle = MessageManager
.getString("label.uniprot_sequence_fetcher");
- private String ftsFrameTitle = defaultFTSFrameTitle;
private static Map<String, Integer> tempUserPrefs = new HashMap<String, Integer>();
+ private static final String UNIPROT_FTS_CACHE_KEY = "CACHE.UNIPROT_FTS";
+
public UniprotFTSPanel(SequenceFetcher seqFetcher)
{
super();
pageLimit = UniProtFTSRestClient.getInstance()
.getDefaultResponsePageSize();
this.seqFetcher = seqFetcher;
- this.progressIdicator = (seqFetcher == null) ? null : seqFetcher
+ this.progressIndicator = (seqFetcher == null) ? null : seqFetcher
.getProgressIndicator();
}
@Override
public void searchAction(boolean isFreshSearch)
{
+ mainFrame.requestFocusInWindow();
if (isFreshSearch)
{
offSet = 0;
}
new Thread()
- {
+ {
@Override
public void run()
{
- ftsFrameTitle = defaultFTSFrameTitle;
reset();
- if (getTypedText().length() > 0)
+ String searchInput = getTypedText();
+ if (searchInput.length() > 0)
{
setSearchInProgress(true);
long startTime = System.currentTimeMillis();
-
+ searchInput = getTypedText();
String searchTarget = ((FTSDataColumnI) cmb_searchTarget
.getSelectedItem()).getAltCode();
-
wantedFields = UniProtFTSRestClient.getInstance()
.getAllDefaultDisplayedFTSDataColumns();
- String searchTerm = decodeSearchTerm(txt_search.getText(),
- searchTarget);
+ String searchTerm = decodeSearchTerm(searchInput, searchTarget);
FTSRestRequest request = new FTSRestRequest();
request.setFieldToSearchBy(searchTarget);
.getString("label.result");
if (isPaginationEnabled() && resultSetCount > 0)
{
- updateSearchFrameTitle(defaultFTSFrameTitle + " - " + result
+ updateSearchFrameTitle(defaultFTSFrameTitle
+ + " - "
+ + result
+ " "
+ totalNumberformatter.format((Number) (offSet + 1))
+ " to "
.format((Number) (offSet + resultSetCount))
+ " of "
+ totalNumberformatter
- .format((Number) totalResultSetCount)
- + " " + " (" + (endTime - startTime) + " milli secs)");
+ .format((Number) totalResultSetCount) + " "
+ + " (" + (endTime - startTime) + " milli secs)");
}
else
{
refreshPaginatorState();
updateSummaryTableSelections();
}
+ txt_search.updateCache();
}
}.start();
return foundSearchTerms;
}
-
@Override
public boolean isPaginationEnabled()
{
@Override
public String getFTSFrameTitle()
{
- return ftsFrameTitle;
+ return defaultFTSFrameTitle;
}
@Override
return tempUserPrefs;
}
+ @Override
+ public String getCacheKey()
+ {
+ return UNIPROT_FTS_CACHE_KEY;
+ }
}