Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » HTML in menu tooltip(I want to be able to use HTML in tooltip of a menu)
HTML in menu tooltip [message #1245101] Thu, 13 February 2014 04:37 Go to next message
Eclipse UserFriend
Hello all,

I am using Eclipse 3.8. We have a requirement by which every menu should display 2 lines in tooltip:
First line must display name of the command followed by the short cut key e.g.
Cut (Ctrl-X)
This line must appear in bold.

Second line must display a very short description of the menu
e.g. Cut selected object
This must not appear in bold.

I tried to use HTML in plugin.properties to achieve this but that didn't work. It displays the text along with HTML tags.

Does Eclipse not support using HMTL in tooltips?
Is there an alternate way in which we can achieve this?

Thanks,
Pradyumna
Re: HTML in menu tooltip [message #1245793 is a reply to message #1245101] Fri, 14 February 2014 04:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi Pradyumna,

you should have a look at the org.eclipse.jface.viewers.ColumnViewerToolTipSupport, which can be used to draw what ever you want on a given Composite.

I guess this snippet is nearly what you want:
ColumnViewerToolTipSupport Snippet

But unfortunally this can only be attached to ColumnViewers, but you got an idea of how to use the swt browser for your needs.

As an alternative you could also consider to use the org.eclipse.ui.forms.widgets.FormText, which is also able to render certain html elements. See this url for further information about the FormText: Forms Article including the FormText widget

To attach a custom ToolTip for a MenuItem, you may want to use an implementation of the org.eclipse.jface.window.ToolTip, on which you could place a SWT Browser or the FormText Widget.

Let me know if you need further assistance Wink

Best regards,

Simon
Re: HTML in menu tooltip [message #1248458 is a reply to message #1245101] Mon, 17 February 2014 04:29 Go to previous message
Eclipse UserFriend
Thanks Simon. I have to digress for another P1 task. Will try out your suggestions later and get back to you if need be. However one thing is for sure there is no trivial solution to this problem where we tweak a line or two and things start working.

Regards,
Pradyumna
Previous Topic:When is IPerspectiveListener4.perspectivePreDeactivate() called?
Next Topic:Programmatically trim a toolbar 3.x
Goto Forum:
  


Current Time: Sat Jul 12 15:24:18 EDT 2025

Powered by FUDForum. Page generated in 0.04121 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top