Creating multiline tooltip for an activity

Article ID: 2308
Last updated: 30 May, 2018
Article ID: 2308
Last updated: 30 May, 2018
Revision: 3
Views: 611
Posted: 18 Apr, 2007
by Dean J.
Updated: 30 May, 2018
by Gargani A.

Question

How to create a multiline tooltip for an activity?

Answer

You can return HTML text from the getToolTipText() method of IlvActivityRenderer orIlvConstraintGraphic to cause tooltips to be rendered across multiple lines. HTML text must be bracketed with an <html> tag at the beginning and an </html> tag at the end. HTML tooltips will work on all currently supported versions of Swing. However, you can verify this by calling theIlvSwingUtil.isHTMLToolTipsSupported() method. You can refer to this chapter of the Swing tutorial for more details on using HTML text within Swing components: .

If you are not using CSS styling, you will need to override the getToolTipText() method in your activity renderer subclass to return HTML formatted text. You can use one of the twocreateMultiLineToolTipText method of the class ilog.views.util.swing.IlvSwingUtil to generate an HTML text string that can be rendered as multiline tool tip.

If you are using CSS styling, then you can directly construct an HTML multiline tooltip string within the stylesheet. Here is an example taken from the Gantt CSS Sample:
activity {
class : 'ilog.views.gantt.graphic.renderer.IlvBasicActivityBar';
toolTipText : 
'@|"<html><center>"+@__ID+"<br>"+@name+"</center>
<hr>Start: "+@startTime+"<br>End: 
"+@endTime+"</html>"';
Notice how this example makes use of <br>, <hr>, and other HTML alignment tags to format the tooltip.
This article was:   Helpful | Not helpful
Report an issue
Article ID: 2308
Last updated: 30 May, 2018
Revision: 3
Views: 611
Posted: 18 Apr, 2007 by Dean J.
Updated: 30 May, 2018 by Gargani A.
Also listed in


Others in this category