import java.util.HashSet;
import java.util.List;
-import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
@SuppressWarnings("serial")
@Override
public void txt_search_ActionPerformed()
{
+ errorWarning.setLength(0);
+ lbl_warning.setVisible(false);
btn_ok.setEnabled(false);
boolean allowEmptySequence = false;
mainFrame.setTitle(MessageManager
} catch (Exception e)
{
// System.out.println(">>>>>>>>>>>>>>>" + e.getMessage());
- JOptionPane.showMessageDialog(this, e.getMessage(),
- "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
+ // JOptionPane.showMessageDialog(this, e.getMessage(),
+ // "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
+ errorWarning.append(e.getMessage());
+ checkForErrors();
return;
}
}
}
+ public void checkForErrors()
+ {
+ lbl_warning.setVisible(false);
+ if (errorWarning.length() > 0)
+ {
+ lbl_warning.setToolTipText(JvSwingUtils.wrapTooltip(true,
+ errorWarning.toString()));
+ lbl_warning.setVisible(true);
+ }
+ }
}
.setTitle("Structure Chooser - Manual association");
if (errors.size() > 0)
{
- StringBuilder errorMsg = new StringBuilder(
- "Operation was unsucessful due to the following: \n");
+ StringBuilder errorMsg = new StringBuilder();
+ // "Operation was unsucessful due to the following: \n");
for (String error : errors)
{
errorMsg.append(error).append("\n");
AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) idInputAssSeqPanel
.getCmb_assSeq().getSelectedItem();
lbl_pdbManualFetchStatus.setIcon(errorImage);
+ lbl_pdbManualFetchStatus.setToolTipText("");
+ if (txt_search.getText().length() > 0)
+ {
+ lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
+ true, "No PDB entry found for \'" + txt_search.getText()
+ + "\'"));
+ }
+
+ if (errorWarning.length() > 0)
+ {
+ lbl_pdbManualFetchStatus.setIcon(warningImage);
+ lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
+ true, errorWarning.toString()));
+ }
+
if (selectedSequences.length == 1
|| !assSeqOpt.getName().equalsIgnoreCase(
"-Select Associated Seq-"))
if (isValidPBDEntry)
{
btn_view.setEnabled(true);
+ lbl_pdbManualFetchStatus.setToolTipText("");
lbl_pdbManualFetchStatus.setIcon(goodImage);
}
}
@Override
protected void txt_search_ActionPerformed()
{
+ errorWarning.setLength(0);
isValidPBDEntry = false;
if (txt_search.getText().length() > 0)
{
resultList = pdbRestCleint.executeRequest(pdbRequest);
} catch (Exception e)
{
- JOptionPane.showMessageDialog(this, e.getMessage(),
- "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
+ // JOptionPane.showMessageDialog(this, e.getMessage(),
+ // "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
+ errorWarning.append(e.getMessage());
return;
} finally
{
- System.out.println(">>>>> executing finally block");
+ // System.out.println(">>>>> executing finally block");
validateSelections();
}
if (resultList.getSearchSummary() != null
}
}
-
}
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
protected JTable tbl_summary = new JTable();
+ protected StringBuilder errorWarning = new StringBuilder();
+
protected JScrollPane scrl_searchResult = new JScrollPane(
tbl_summary);
+ protected ImageIcon warningImage = new ImageIcon(getClass().getResource(
+ "/images/warning.gif"));
+
+ protected JLabel lbl_warning = new JLabel(warningImage);
+
private JTabbedPane tabbedPane = new JTabbedPane();
private PDBDocFieldPreferences pdbDocFieldPrefs = new PDBDocFieldPreferences(
*/
private void jbInit() throws Exception
{
+ lbl_warning.setVisible(false);
+ lbl_warning.setFont(new java.awt.Font("Verdana", 0, 12));
+
tbl_summary.setAutoCreateRowSorter(true);
tbl_summary.addMouseListener(new MouseAdapter()
{
});
populateCmbSearchTargetOptions();
-
+ txt_search.setToolTipText(MessageManager
+ .getString("label.separate_multiple_accession_ids"));
txt_search.setFont(new java.awt.Font("Verdana", 0, 12));
txt_search.getDocument().addDocumentListener(new DocumentListener()
{
pnl_results.add(tabbedPane);
pnl_inputs.add(cmb_searchTarget);
pnl_inputs.add(txt_search);
+ pnl_inputs.add(lbl_warning);
this.setLayout(mainLayout);
this.add(pnl_inputs, java.awt.BorderLayout.NORTH);
protected JComboBox<FilterOption> cmb_filterOption = new JComboBox<FilterOption>();
protected AlignmentPanel ap;
+
+ protected StringBuilder errorWarning = new StringBuilder();
protected JLabel lbl_result = new JLabel(
MessageManager.getString("label.select"));
protected ImageIcon errorImage = new ImageIcon(getClass().getResource(
"/images/error.png"));
+ protected ImageIcon warningImage = new ImageIcon(getClass().getResource(
+ "/images/warning.gif"));
+
+ protected JLabel lbl_warning = new JLabel(warningImage);
+
protected JLabel lbl_loading = new JLabel(loadingImage);
protected JLabel lbl_pdbManualFetchStatus = new JLabel(errorImage);
else if (exceptionMsg.contains("UnknownHostException"))
{
throw new Exception(
- "Jalview couldn't reach the host server @ www.ebi.ac.uk"
- + "\nPlease ensure that you are connected to the internet.");
+ "Jalview is unable to reach the host server \'www.ebi.ac.uk\'. "
+ + "\nPlease ensure that you are connected to the internet and try again.");
// The server 'www.ebi.ac.uk' is unreachable
}
else