如何在条目上添加工具提示,而不是在JFace ComboViewer中的组合上添加 [英] how to add tooltip on the entries and NOT on the combo in JFace ComboViewer

查看:284
本文介绍了如何在条目上添加工具提示,而不是在JFace ComboViewer中的组合上添加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在加载超过一千个元素的 ComboViewer

I am loading my ComboViewer with over one thousand elements.

某些元素的长度大于

我想在条目上添加工具提示,而不是在组合上添加

I want to add tooltip on the entries and NOT on the combo.

我想要这样一种方式,当列表下降,用户将鼠标指针放在其中一个值时,整个文本应该可以通过 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的子项,其中一个应该是列表控制它显示为下拉菜单。您可以将 MouseTrackListener 添加到列表控件中,并根据鼠标悬停的项目显示工具提示。

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中的组合上添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆