temp push
[jalview.git] / src / jalview / gui / JvSwingUtils.java
index d6090e2..7dd3e80 100644 (file)
@@ -48,6 +48,8 @@ import javax.swing.SwingConstants;
 import javax.swing.border.Border;
 import javax.swing.border.TitledBorder;
 
+import jalview.util.MessageManager;
+
 /**
  * useful functions for building Swing GUIs
  * 
@@ -56,12 +58,15 @@ import javax.swing.border.TitledBorder;
  */
 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,10 +99,8 @@ public final class JvSwingUtils
     {
       return enclose ? "<html>" + ttext + "</html>" : ttext;
     }
-
-    return (enclose ? "<html>" : "")
-            + "<style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
-            + ttext + "</p>" + ((enclose ? "</html>" : ""));
+    // BH 2018,2019
+    return (enclose ? HTML_PREFIX + ttext + "</div></html>" : ttext);
 
   }
 
@@ -341,6 +344,7 @@ public final class JvSwingUtils
           combo.setToolTipText(tooltips.get(j));
         }
       }
+
       @Override
       public void mouseExited(MouseEvent e)
       {