how to add tooltip on the entries and NOT on the combo in JFace ComboViewer(如何在条目上而不是在 JFace ComboViewer 中的组合上添加工具提示)
问题描述
我正在加载包含一千多个元素的 ComboViewer
.
I am loading my ComboViewer
with over one thousand elements.
有些元素比底层combo
的宽度还要长.
Some elements are longer than the width of underlying combo
.
我想在条目上添加工具提示,而不是在 combo
上.
I want to add tooltip on the entries and NOT on the combo
.
我希望这样,当列表下拉并且用户将鼠标指针放在其中一个值上时,整个文本应该可以通过 tooltip
显示,类似于 tooltip
为 JFace TableViewer
显示.
I want it in such a way that, when the list drops down and the user places the mouse pointer over one of the value, the entire text should be displayable via tooltip
similar to the tooltip
shown for a JFace TableViewer
.
推荐答案
如果您使用的是 ComboViewer
并且您提供自己的 CCombo
实例,您可以获得CCombo 和其中之一应该是一个显示为下拉菜单的 List
控件.您可以将 MouseTrackListener
添加到此 List
控件并根据鼠标悬停的项目显示工具提示.
If you are using a ComboViewer
and you provide your own CCombo
instance, you can get children of the CCombo and one of them should be a List
control that it shows as a dropdown menu. You can add your MouseTrackListener
to this List
control and show tooltip depending on which item the mouse is hovering.
这篇关于如何在条目上而不是在 JFace ComboViewer 中的组合上添加工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在条目上而不是在 JFace ComboViewer 中的组合上添加工具提示


- Jersey REST 客户端:发布多部分数据 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01