문제

What is the exact use of ColumnViewerTooltipSupport? I know that it provides tooltip support for ColumnViewers but does it mean that it provides tooltip for treeViewers? How can I use this feature to provide tooltip support individually different tooltips for my each tree item when the mouse hovers over each item? Do I require a MouseListener for this or does the ColumnViewerTooltipSupport class provide it by default? Can someone please help me out here as I'm relatively new to SWT concepts.

My tooltip has multiple lines, How can I wrap the text and display it neatly? It seems like ColumnViewerToolTipSupport class does not wrap the tooltip text if the text is too long. I would like to use a tooltip window with a vertical scroll bar just like the InformationControl Windows in eclipse? If something like eclipse is not possible then just a tooltip window with wrapped up text.

Please show me an example snippet?

도움이 되었습니까?

해결책

ColumnViewerToolTipSupport adds support for individual tooltips to TableViewer and TreeViewer (and other ColumnViewers), you enable this using:

ColumnViewerToolTipSupport.enableFor(viewer);

The support expects that the label provider(s) for the viewer are based on CellLabelProvider (or one of its subclasses).

CellLabelProvider has getToolTipImage, getToolTipText, getToolTipBackgroundColor, getToolTipForegroundColor, getToolTipFont and getToolTipShift methods that you can override to control the tooltips.

Note: All this is JFace code not pure SWT

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top