JAL-1834 added tooltip to the PDB sequence fetcher and structure chooser summary...
[jalview.git] / src / jalview / jbgui / GStructureChooser.java
index 8596081..9e4e6f3 100644 (file)
@@ -24,6 +24,7 @@ package jalview.jbgui;
 import jalview.datamodel.SequenceI;
 import jalview.gui.AlignmentPanel;
 import jalview.gui.Desktop;
+import jalview.gui.JvSwingUtils;
 import jalview.jbgui.PDBDocFieldPreferences.PreferenceSource;
 import jalview.util.MessageManager;
 import jalview.ws.dbsources.PDBRestClient;
@@ -148,7 +149,27 @@ public abstract class GStructureChooser extends JPanel implements
 
   protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB";
 
-  protected JTable tbl_summary = new JTable();
+  protected JTable tbl_summary = new JTable()
+  {
+    public String getToolTipText(MouseEvent evt)
+    {
+      String toolTipText = null;
+      java.awt.Point pnt = evt.getPoint();
+      int rowIndex = rowAtPoint(pnt);
+      int colIndex = columnAtPoint(pnt);
+
+      try
+      {
+        toolTipText = getValueAt(rowIndex, colIndex).toString();
+      } catch (Exception e)
+      {
+        e.printStackTrace();
+      }
+      toolTipText = (toolTipText == null ? null : JvSwingUtils.wrapTooltip(
+              true, toolTipText));
+      return toolTipText;
+    }
+  };
 
   protected JScrollPane scrl_foundStructures = new JScrollPane(
           tbl_summary);