JAL-1748 house keeping
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 29 May 2015 15:41:10 +0000 (16:41 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 29 May 2015 15:41:10 +0000 (16:41 +0100)
resources/lang/Messages.properties
src/jalview/gui/PDBSearchPanel.java
src/jalview/jbgui/GPDBSearchPanel.java

index 9cf90c7..ee6b92d 100644 (file)
@@ -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}
index 3185ae2..964a7d8 100644 (file)
@@ -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<String> selectedIdsSet = new HashSet<String>();
     int pdbIdCol = PDBRestClient.getPDBIdColumIndex(wantedFields, false);
index ee4757e..c235560 100644 (file)
@@ -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<PDBDocField> getCmbSearchTarget()
   {
     return cmb_searchTarget;