eclipseeclipse-plugineclipse-rcpjface

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


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.


Solution

  • 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.