Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:37 Go to next message
Pradyumna Bhide is currently offline Pradyumna BhideFriend
Messages: 18
Registered: August 2013
Junior Member
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 09:19 Go to previous messageGo to next message
Simon Scholz is currently offline Simon ScholzFriend
Messages: 73
Registered: April 2012
Location: Germany
Member
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 09:29 Go to previous message
Pradyumna Bhide is currently offline Pradyumna BhideFriend
Messages: 18
Registered: August 2013
Junior Member
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: Fri Apr 19 15:35:15 GMT 2024

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

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

Back to the top