view raw
Zordid Zordid - 10 months ago 124
Java Question

JFace TableViewer shows two tooltips - custom and default

I got a strange situation here where I need help.

I create a fairly simple JFace Table using a

. When you do nothing more, you can see the following behavior: when a cell's text is too large, a tooltip showing the complete text will appear after a short wait. That's normal behavior and I guess that the native controls draw these tooltips.

Now I added my own custom tooltips, using

ColumnViewerToolTipSupport.enableFor( tableViewer, ToolTip.NO_RECREATE );

And delivering a (different) text using
method of a label provider.

That works - almost. I got one problem: sometimes (not all the times!) first, the native tooltip appears and shortly thereafter my custom tooltip is drawn on top of it, like shown in this screenshot:

Screenshot showing two tooltips

I have no idea how to effectively disable the native tooltips each cell wants to draw. It's ugly as hell the way it is...

Any clues for me? Thanks!


You can effectively disable the native table tooltip like this:


See also...

for reference.