temp push
[jalview.git] / src / jalview / gui / JvSwingUtils.java
index 2f4a0fe..7dd3e80 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.gui;
 
+import jalview.util.MessageManager;
+
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
@@ -56,12 +58,15 @@ import jalview.util.MessageManager;
  */
 public final class JvSwingUtils
 {
+  static final String HTML_PREFIX = "<html><div style=\"width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;\">";
+
   /**
    * wrap a bare html safe string to around 60 characters per line using a CSS
    * style class specifying word-wrap and break-word
    * 
    * @param enclose
-   *          if true, add &lt;html&gt; wrapper tags
+   *          if true, add &lt;html&gt; wrapper tags (currently false for only
+   *          two references -- both in Jws2Discoverer --
    * @param ttext
    * 
    * @return
@@ -94,16 +99,9 @@ public final class JvSwingUtils
     {
       return enclose ? "<html>" + ttext + "</html>" : ttext;
     }
+    // BH 2018,2019
+    return (enclose ? HTML_PREFIX + ttext + "</div></html>" : ttext);
 
-    return (enclose ? "<html>" : "")
-     // BH 2018
-            + "<style> div.ttip {width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;}</style><div class=\"ttip\">"
-//            + "<style> p.ttip {width:350px;margin:-14px 0px -14px 0px;padding:2px;overflow-wrap:break-word;}"
-//            + "</style><p class=\"ttip\">"
-            + ttext
-            + " </div>"
-//            + "</p>"
-            + ((enclose ? "</html>" : ""));
   }
 
   public static JButton makeButton(String label, String tooltip,
@@ -346,6 +344,7 @@ public final class JvSwingUtils
           combo.setToolTipText(tooltips.get(j));
         }
       }
+
       @Override
       public void mouseExited(MouseEvent e)
       {