Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » [UI forms] getting reference to a Form's TitleLabel
[UI forms] getting reference to a Form's TitleLabel [message #551397] Fri, 06 August 2010 09:35 Go to next message
Henno Vermeulen is currently offline Henno VermeulenFriend
Messages: 126
Registered: July 2009
Senior Member
I hope this is the right forum for my Eclipse UI forms question...

I would like to set a tooltiptext to the TitleLabel inside a Form.

Calling setToolTipText on the form does not work. Setting it on form.getHead() puts the tooltip on the area which shows messages which is not what I want because it gets overriden anyway.

I am also using a custom org.eclipse.jface.window.ToolTip so I will need a reference to the Control that has the label, which is:

form.head.titleRegion.titleLabel and it is totally internal to Eclipse...

Should I give up and redesign my UI and put my tooltip somewhere else? Should I do dirty reflection tricks or should I post a feature request on the Eclipse Bugzilla?
Re: [UI forms] getting reference to a Form's TitleLabel [message #551399 is a reply to message #551397] Fri, 06 August 2010 09:46 Go to previous messageGo to next message
Henno Vermeulen is currently offline Henno VermeulenFriend
Messages: 126
Registered: July 2009
Senior Member
Oh well, the dirty reflection trick seems to work...

DISCLAIMER: I am using Eclipse internal stuff and this may not work in the future...... (I tested it with ui forms 3.4.1)

		Form form = headerForm.getForm();
		Object titleRegion = ReflectionUtil.readField(form
				.getHead(), "titleRegion");
		Label titleLabel = (Label) ReflectionUtil.readField(titleRegion,
				"titleLabel");
		new FancyToolTip(titleLabel,
				"<forms><p>This is a <b>test</b></p><p>hahaha</p></forms>");


Where FancyToolTip is from here.

[Updated on: Fri, 06 August 2010 09:51]

Report message to a moderator

Re: [UI forms] getting reference to a Form's TitleLabel [message #552229 is a reply to message #551397] Wed, 11 August 2010 11:25 Go to previous messageGo to next message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
You can ask Eclipse UI Forms questions in the Platform-User Assistance forum and JFace questions in the JFace forum.

Lakshmi P Shanmugam
Re: [UI forms] getting reference to a Form's TitleLabel [message #552231 is a reply to message #552229] Wed, 11 August 2010 11:28 Go to previous message
Henno Vermeulen is currently offline Henno VermeulenFriend
Messages: 126
Registered: July 2009
Senior Member
Ok thank you, I knew the JFace forum but I didn't know of the Platform-User Assistance forum.
Previous Topic:JVM crashes on Solaris sparc 5.10 with Eclipse 3.4 and some plugins
Next Topic:Freeze first row on table
Goto Forum:
  


Current Time: Thu Mar 28 11:46:55 GMT 2024

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

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

Back to the top