protected JButton btn_cancel = new JButton();
- protected JTextField txt_search = new JTextField(35);
+ protected JTextField txt_search = new JTextField(30);
protected SequenceFetcher seqFetcher;
protected ImageIcon loadingImage = new ImageIcon(getClass().getResource(
"/images/loading.gif"));
+ protected ImageIcon balnkPlaceholderImage = new ImageIcon(getClass()
+ .getResource("/images/blank_16x16_placeholder.png"));
+
protected JLabel lbl_warning = new JLabel(warningImage);
protected JLabel lbl_loading = new JLabel(loadingImage);
+ protected JLabel lbl_blank = new JLabel(balnkPlaceholderImage);
+
private JTabbedPane tabbedPane = new JTabbedPane();
private JPanel pnl_actions = new JPanel();
lbl_warning.setFont(new java.awt.Font("Verdana", 0, 12));
lbl_loading.setVisible(false);
lbl_loading.setFont(new java.awt.Font("Verdana", 0, 12));
+ lbl_blank.setVisible(true);
+ lbl_blank.setFont(new java.awt.Font("Verdana", 0, 12));
tbl_summary.setAutoCreateRowSorter(true);
tbl_summary.getTableHeader().setReorderingAllowed(false);
});
btn_next_page.setEnabled(false);
+ btn_next_page.setToolTipText(MessageManager
+ .getString("label.next_page_tooltop"));
btn_next_page.setFont(new java.awt.Font("Verdana", 0, 12));
btn_next_page.setText(MessageManager.getString("action.next_page"));
btn_next_page.addActionListener(new java.awt.event.ActionListener()
});
btn_prev_page.setEnabled(false);
+ btn_prev_page.setToolTipText(MessageManager
+ .getString("label.prev_page_tooltop"));
btn_prev_page.setFont(new java.awt.Font("Verdana", 0, 12));
btn_prev_page.setText(MessageManager.getString("action.prev_page"));
btn_prev_page.addActionListener(new java.awt.event.ActionListener()
});
final DeferredTextInputListener listener = new DeferredTextInputListener(
- 2500,
+ 1500,
new ActionListener()
{
@Override
@Override
public void focusLost(FocusEvent e)
{
- listener.stop();
+// listener.stop();
}
});
pnl_inputs.add(txt_search);
pnl_inputs.add(lbl_loading);
pnl_inputs.add(lbl_warning);
+ pnl_inputs.add(lbl_blank);
pnl_inputs.add(btn_prev_page);
pnl_inputs.add(btn_next_page);
protected void checkForErrors()
{
lbl_warning.setVisible(false);
+ lbl_blank.setVisible(true);
if (errorWarning.length() > 0)
{
lbl_loading.setVisible(false);
+ lbl_blank.setVisible(false);
lbl_warning.setToolTipText(JvSwingUtils.wrapTooltip(true,
errorWarning.toString()));
lbl_warning.setVisible(true);
lbl_loading.setVisible(false);
errorWarning.setLength(0);
lbl_warning.setVisible(false);
+ lbl_blank.setVisible(true);
btn_ok.setEnabled(false);
mainFrame.setTitle(getFTSFrameTitle());
referesh();
@Override
public void setSearchInProgress(Boolean isSearchInProgress)
{
+ lbl_blank.setVisible(!isSearchInProgress);
lbl_loading.setVisible(isSearchInProgress);
}
public void referesh()
int responseSize = (uniportRestRequest.getResponseSize() == 0) ? getDefaultResponsePageSize()
: uniportRestRequest.getResponseSize();
- int offSet = (uniportRestRequest.getOffSet() == 0) ? getDefaultResponsePageSize()
- : uniportRestRequest.getOffSet();
+ int offSet = uniportRestRequest.getOffSet();
String query = uniportRestRequest.getFieldToSearchBy()
.equalsIgnoreCase("Search All") ? uniportRestRequest
// : " AND status:REL");
// System.out.println(">>>>> Query : " + query);
// System.out.println(">>>>> Columns : " + wantedFields);
+ // System.out.println(">>>>> Response size: " + responseSize
+ // + " offset : "
+ // + offSet);
WebResource webResource = null;
webResource = client.resource(UNIPROT_SEARCH_ENDPOINT)
.queryParam("format", "tab")
{
FTSRestResponse searchResult = new FTSRestResponse();
List<FTSData> result = null;
+ if (uniProtTabDelimittedResponseString == null
+ || uniProtTabDelimittedResponseString.trim().isEmpty())
+ {
+ searchResult.setNumberOfItemsFound(0);
+ return searchResult;
+ }
String[] foundDataRow = uniProtTabDelimittedResponseString.split("\n");
if (foundDataRow != null && foundDataRow.length > 0)
{
long endTime = System.currentTimeMillis();
resultSetCount = resultList.getNumberOfItemsFound();
- String result = (resultSetCount > 1) ? MessageManager
+ String result = (resultSetCount > 0) ? MessageManager
.getString("label.results") : MessageManager
.getString("label.result");
- if (isPaginationEnabled() && resultSetCount > 1)
+ if (isPaginationEnabled() && resultSetCount > 0)
{
updateSearchFrameTitle(defaultFTSFrameTitle + " - " + result
- + " " + offSet + " to " + (offSet + resultSetCount)
+ + " " + (offSet + 1) + " to "
+ + (offSet + resultSetCount)
+ " " + " (" + (endTime - startTime) + " milli secs)");
}
else