git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2810 auto search checkbox state stored as user preference. Enabled by default.
[jalview.git]
/
src
/
jalview
/
fts
/
service
/
uniprot
/
UniprotFTSPanel.java
diff --git
a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java
b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java
index
bff0d80
..
df54dea
100644
(file)
--- a/
src/jalview/fts/service/uniprot/UniprotFTSPanel.java
+++ b/
src/jalview/fts/service/uniprot/UniprotFTSPanel.java
@@
-40,24
+40,26
@@
public class UniprotFTSPanel extends GFTSPanel
private static String defaultFTSFrameTitle = MessageManager
.getString("label.uniprot_sequence_fetcher");
private static String defaultFTSFrameTitle = MessageManager
.getString("label.uniprot_sequence_fetcher");
-
- private static Map<String, Integer> tempUserPrefs = new HashMap<String, Integer>();
+ private static Map<String, Integer> tempUserPrefs = new HashMap<>();
private static final String UNIPROT_FTS_CACHE_KEY = "CACHE.UNIPROT_FTS";
private static final String UNIPROT_FTS_CACHE_KEY = "CACHE.UNIPROT_FTS";
- public UniprotFTSPanel(SequenceFetcher seqFetcher)
+ private static final String UNIPROT_AUTOSEARCH = "FTS.UNIPROT.AUTOSEARCH";
+
+ public UniprotFTSPanel(SequenceFetcher fetcher)
{
{
- super();
+ super(fetcher);
pageLimit = UniProtFTSRestClient.getInstance()
.getDefaultResponsePageSize();
pageLimit = UniProtFTSRestClient.getInstance()
.getDefaultResponsePageSize();
- this.seqFetcher = seqFetcher;
- this.progressIndicator = (seqFetcher == null) ? null : seqFetcher
- .getProgressIndicator();
+ this.seqFetcher = fetcher;
+ this.progressIndicator = (fetcher == null) ? null
+ : fetcher.getProgressIndicator();
}
@Override
public void searchAction(boolean isFreshSearch)
{
}
@Override
public void searchAction(boolean isFreshSearch)
{
+ mainFrame.requestFocusInWindow();
if (isFreshSearch)
{
offSet = 0;
if (isFreshSearch)
{
offSet = 0;
@@
-85,26
+87,25
@@
public class UniprotFTSPanel extends GFTSPanel
request.setSearchTerm(searchTerm);
request.setOffSet(offSet);
request.setWantedFields(wantedFields);
request.setSearchTerm(searchTerm);
request.setOffSet(offSet);
request.setWantedFields(wantedFields);
- FTSRestClientI uniProtRestCleint = UniProtFTSRestClient
+ FTSRestClientI uniProtRestClient = UniProtFTSRestClient
.getInstance();
FTSRestResponse resultList;
try
{
.getInstance();
FTSRestResponse resultList;
try
{
- resultList = uniProtRestCleint.executeRequest(request);
+ resultList = uniProtRestClient.executeRequest(request);
} catch (Exception e)
{
} catch (Exception e)
{
- e.printStackTrace();
setErrorMessage(e.getMessage());
checkForErrors();
setErrorMessage(e.getMessage());
checkForErrors();
+ setSearchInProgress(false);
return;
}
if (resultList.getSearchSummary() != null
&& resultList.getSearchSummary().size() > 0)
{
return;
}
if (resultList.getSearchSummary() != null
&& resultList.getSearchSummary().size() > 0)
{
- getResultTable().setModel(
- FTSRestResponse.getTableModel(request,
- resultList.getSearchSummary()));
+ getResultTable().setModel(FTSRestResponse.getTableModel(request,
+ resultList.getSearchSummary()));
FTSRestResponse.configureTableColumn(getResultTable(),
wantedFields, tempUserPrefs);
getResultTable().setVisible(true);
FTSRestResponse.configureTableColumn(getResultTable(),
wantedFields, tempUserPrefs);
getResultTable().setVisible(true);
@@
-114,14
+115,12
@@
public class UniprotFTSPanel extends GFTSPanel
totalResultSetCount = resultList.getNumberOfItemsFound();
resultSetCount = resultList.getSearchSummary() == null ? 0
: resultList.getSearchSummary().size();
totalResultSetCount = resultList.getNumberOfItemsFound();
resultSetCount = resultList.getSearchSummary() == null ? 0
: resultList.getSearchSummary().size();
- String result = (resultSetCount > 0) ? MessageManager
- .getString("label.results") : MessageManager
- .getString("label.result");
+ String result = (resultSetCount > 0)
+ ? MessageManager.getString("label.results")
+ : MessageManager.getString("label.result");
if (isPaginationEnabled() && resultSetCount > 0)
{
if (isPaginationEnabled() && resultSetCount > 0)
{
- updateSearchFrameTitle(defaultFTSFrameTitle
- + " - "
- + result
+ updateSearchFrameTitle(defaultFTSFrameTitle + " - " + result
+ " "
+ totalNumberformatter.format((Number) (offSet + 1))
+ " to "
+ " "
+ totalNumberformatter.format((Number) (offSet + 1))
+ " to "
@@
-129,8
+128,8
@@
public class UniprotFTSPanel extends GFTSPanel
.format((Number) (offSet + resultSetCount))
+ " of "
+ totalNumberformatter
.format((Number) (offSet + resultSetCount))
+ " of "
+ totalNumberformatter
- .format((Number) totalResultSetCount) + " "
- + " (" + (endTime - startTime) + " milli secs)");
+ .format((Number) totalResultSetCount)
+ + " " + " (" + (endTime - startTime) + " milli secs)");
}
else
{
}
else
{
@@
-186,12
+185,12
@@
public class UniprotFTSPanel extends GFTSPanel
{
disableActionButtons();
StringBuilder selectedIds = new StringBuilder();
{
disableActionButtons();
StringBuilder selectedIds = new StringBuilder();
- HashSet<String> selectedIdsSet = new HashSet<String>();
+ HashSet<String> selectedIdsSet = new HashSet<>();
int primaryKeyColIndex = 0;
try
{
int primaryKeyColIndex = 0;
try
{
- primaryKeyColIndex = getFTSRestClient().getPrimaryKeyColumIndex(
- wantedFields, false);
+ primaryKeyColIndex = getFTSRestClient()
+ .getPrimaryKeyColumIndex(wantedFields, false);
} catch (Exception e)
{
e.printStackTrace();
} catch (Exception e)
{
e.printStackTrace();
@@
-199,8
+198,8
@@
public class UniprotFTSPanel extends GFTSPanel
int[] selectedRows = getResultTable().getSelectedRows();
for (int summaryRow : selectedRows)
{
int[] selectedRows = getResultTable().getSelectedRows();
for (int summaryRow : selectedRows)
{
- String idStr = getResultTable().getValueAt(summaryRow,
- primaryKeyColIndex).toString();
+ String idStr = getResultTable()
+ .getValueAt(summaryRow, primaryKeyColIndex).toString();
selectedIdsSet.add(idStr);
}
selectedIdsSet.addAll(paginatorCart);
selectedIdsSet.add(idStr);
}
selectedIdsSet.addAll(paginatorCart);
@@
-240,4
+239,10
@@
public class UniprotFTSPanel extends GFTSPanel
{
return UNIPROT_FTS_CACHE_KEY;
}
{
return UNIPROT_FTS_CACHE_KEY;
}
+
+ @Override
+ public String getAutosearchPreference()
+ {
+ return UNIPROT_AUTOSEARCH;
+ }
}
}