{
Objects.requireNonNull(ttext, "Tootip text to format must not be null!");
ttext = ttext.trim();
- boolean maxLenghtExceeded = false;
+ boolean maxLengthExceeded = false;
- /*
- * Split into lines if already separated by <br> tags.
- *
- * TODO what about </br>, <br/>, <br /> ?
- */
if (ttext.contains("<br>"))
{
String[] htmllines = ttext.split("<br>");
{
return enclose ? "<html>" + ttext + "</html>" : ttext;
}
- else
- {
+
- return enclose ? "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
- + ttext + "</p></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>" : ""));
- }
++
}
public static JButton makeButton(String label, String tooltip,