JFace TableViewer显示了两个工具提示-自定义和默认 [英] JFace TableViewer shows two tooltips - custom and default
问题描述
在这里我需要帮助。
我使用 TableViewer $ c $创建了一个相当简单的JFace Table c>。当您什么都不做时,您会看到以下行为:当单元格的文本太大时,短暂的等待后会出现一个显示完整文本的工具提示。这是正常现象,我想原生控件会绘制这些工具提示。
I create a fairly simple JFace Table using a TableViewer
. 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.
现在,我使用
ColumnViewerToolTipSupport.enableFor( tableViewer, ToolTip.NO_RECREATE );
并使用 getToolTipText()$ c传递(不同的)文本$ c>标签提供者的方法。
And delivering a (different) text using getToolTipText()
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:
我有不知道如何有效地禁用每个单元格想要绘制的本机工具提示。
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?
推荐答案
您可以像这样有效地禁用本机表工具提示:
You can effectively disable the native table tooltip like this:
viewer.getTable().setToolTipText("");
另请参阅...
- 在下方回答>Rüdiger,添加了我的答案中缺少的一些重要提示和细节
- 此Eclipse Bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=218471 - 以及此Eclipse代码段
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse。 swt.snippets / src / org / eclipse / swt / snippets / Snippet125.java
- answer below from Rüdiger, adding some important hints and details missing in my answer
- this Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=218471
- and this Eclipse code snippet http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet125.java
供参考。
这篇关于JFace TableViewer显示了两个工具提示-自定义和默认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!