how to add tooltip on the entries and NOT on the combo in JFace ComboViewer

不羁岁月 提交于 2019-12-19 10:04:03

问题


I am loading my ComboViewer with over one thousand elements.

Some elements are longer than the width of underlying combo.

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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/13416164/how-to-add-tooltip-on-the-entries-and-not-on-the-combo-in-jface-comboviewer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!