From: tcofoegbu Date: Fri, 29 May 2015 15:41:10 +0000 (+0100) Subject: JAL-1748 house keeping X-Git-Tag: Release_2_10_0~651 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2771b2433e6a8dfe171bc9d765381e287f8f221a;p=jalview.git JAL-1748 house keeping --- diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 9cf90c7..ee6b92d 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -770,8 +770,9 @@ label.transformed_points_for_params = Transformed points for {0} label.graduated_color_for_params = Graduated Feature Colour for {0} label.select_backgroud_colour = Select Background Colour label.invalid_font = Invalid Font -label.separate_multiple_accession_ids = Separate multiple PDB accession ids with semi colon ";" -label.separate_multiple_query_values = Separate multiple query values with semi colon ";" +label.separate_multiple_accession_ids = Enter one or more PDB Ids +label.separate_multiple_query_values = Enter one or more {0}s separated by a semi-colon ";" +label.search_all = Enter one or more search values separated by a semi-colon ";" (Note: This Searches the entire PDB database) label.replace_commas_semicolons = Replace commas with semi-colons label.parsing_failed_syntax_errors_shown_below_param = Parsing failed. Syntax errors shown below {0} label.parsing_failed_unrecoverable_exception_thrown_param = \nParsing failed. An unrecoverable exception was thrown\:\n {0} diff --git a/src/jalview/gui/PDBSearchPanel.java b/src/jalview/gui/PDBSearchPanel.java index 3185ae2..964a7d8 100644 --- a/src/jalview/gui/PDBSearchPanel.java +++ b/src/jalview/gui/PDBSearchPanel.java @@ -177,7 +177,7 @@ public class PDBSearchPanel extends GPDBSearchPanel public void transferToSequenceFetcher(String ids) { - mainFrame.dispose(); + // mainFrame.dispose(); seqFetcher.textArea.setText(ids); Thread worker = new Thread(seqFetcher); worker.start(); @@ -188,7 +188,7 @@ public class PDBSearchPanel extends GPDBSearchPanel */ public void loadSelectedPDBSequencesToAlignment() { - mainFrame.dispose(); + // mainFrame.dispose(); StringBuilder selectedIds = new StringBuilder(); HashSet selectedIdsSet = new HashSet(); int pdbIdCol = PDBRestClient.getPDBIdColumIndex(wantedFields, false); diff --git a/src/jalview/jbgui/GPDBSearchPanel.java b/src/jalview/jbgui/GPDBSearchPanel.java index ee4757e..c235560 100644 --- a/src/jalview/jbgui/GPDBSearchPanel.java +++ b/src/jalview/jbgui/GPDBSearchPanel.java @@ -22,6 +22,7 @@ package jalview.jbgui; import jalview.gui.Desktop; +import jalview.gui.JvSwingUtils; import jalview.jbgui.PDBDocFieldPreferences.PreferenceSource; import jalview.util.MessageManager; import jalview.ws.dbsources.PDBRestClient.PDBDocField; @@ -128,14 +129,11 @@ tbl_summary); { public void mouseClicked(MouseEvent e) { - if (tbl_summary.getSelectedRows().length > 0) - { - btn_ok.setEnabled(true); - } - else - { - btn_ok.setEnabled(false); - } + validateSelection(); + } + public void mouseReleased(MouseEvent e) + { + validateSelection(); } }); @@ -180,14 +178,26 @@ tbl_summary); @Override public void actionPerformed(ActionEvent e) { - txt_search.setToolTipText(MessageManager - .getString("label.separate_multiple_query_values")); - if ("pdb id".equalsIgnoreCase(getCmbSearchTarget() + String tooltipText; + if ("all".equalsIgnoreCase(getCmbSearchTarget().getSelectedItem() + .toString())) + { + tooltipText = MessageManager.getString("label.search_all"); + } + else if ("pdb id".equalsIgnoreCase(getCmbSearchTarget() .getSelectedItem().toString())) { - txt_search.setToolTipText(MessageManager - .getString("label.separate_multiple_accession_ids")); + tooltipText = MessageManager + .getString("label.separate_multiple_accession_ids"); } + else + { + tooltipText = MessageManager.formatMessage( + "label.separate_multiple_query_values", new Object[] + { getCmbSearchTarget().getSelectedItem().toString() }); + } + txt_search.setToolTipText(JvSwingUtils.wrapTooltip(true, + tooltipText)); txt_search_ActionPerformed(); } }); @@ -280,6 +290,17 @@ tbl_summary); Desktop.addInternalFrame(mainFrame, frameTitle, 800, 400); } + public void validateSelection() + { + if (tbl_summary.getSelectedRows().length > 0) + { + btn_ok.setEnabled(true); + } + else + { + btn_ok.setEnabled(false); + } + } public JComboBox getCmbSearchTarget() { return cmb_searchTarget;