JAL-3060 more extensive extract method refactoring of FeatureEditor
[jalview.git] / src / jalview / gui / FeatureSettings.java
index 062eda1..0e18d91 100644 (file)
@@ -81,8 +81,6 @@ import javax.swing.Icon;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JColorChooser;
-import javax.swing.JDialog;
 import javax.swing.JInternalFrame;
 import javax.swing.JLabel;
 import javax.swing.JLayeredPane;
@@ -221,7 +219,7 @@ public class FeatureSettings extends JPanel
         case COLOUR_COLUMN:
           FeatureColourI colour = (FeatureColourI) table.getValueAt(row,
                   column);
-          tip = getColorTooltip(colour);
+          tip = getColorTooltip(colour, true);
           break;
         case FILTER_COLUMN:
           FeatureMatcherSet o = (FeatureMatcherSet) table.getValueAt(row,
@@ -1362,15 +1360,18 @@ public class FeatureSettings extends JPanel
    * Answers a suitable tooltip to show on the colour cell of the table
    * 
    * @param fcol
+   * @param withHint
+   *          if true include 'click to edit' and similar text
    * @return
    */
-  public static String getColorTooltip(FeatureColourI fcol)
+  public static String getColorTooltip(FeatureColourI fcol,
+          boolean withHint)
   {
     if (fcol == null)
     {
       return null;
     }
-    if (fcol.isSimpleColour())
+    if (fcol.isSimpleColour() && withHint)
     {
       return BASE_TOOLTIP;
     }
@@ -1378,7 +1379,10 @@ public class FeatureSettings extends JPanel
     description = description.replaceAll("<", "&lt;");
     description = description.replaceAll(">", "&gt;");
     StringBuilder tt = new StringBuilder(description);
-    tt.append("<br>").append(BASE_TOOLTIP).append("</br>");
+    if (withHint)
+    {
+      tt.append("<br>").append(BASE_TOOLTIP).append("</br>");
+    }
     return JvSwingUtils.wrapTooltip(true, tt.toString());
   }