Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Underlying Control(Retrieve Underying Control)
Underlying Control [message #712659] Sun, 07 August 2011 15:09 Go to next message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 213
Registered: July 2009
Senior Member
Hi,

Can anyone tell me how to retrieve the underlying SWT control from an ISapphire part.

e.g. I want to retrieve the java.swt.widgets.Text from an ISapphirePart which is a of type PropertyEditor.

Thanks.
Kamesh
Re: Underlying Control [message #713200 is a reply to message #712659] Mon, 08 August 2011 07:57 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 213
Registered: July 2009
Senior Member
I used the following method to get the Text control associated with the Property Editor
The following method snippet is inside the Object run( SapphireRenderingContext context ) of the SapphireActionHandler

if ( sapphirePart instanceof SapphirePropertyEditor ) {

			SapphirePropertyEditor propertyEditor = (SapphirePropertyEditor) sapphirePart;

			ModelProperty property = propertyEditor.getProperty();

			Text javaTypeText =
				SapphirePropertyEditor.findControlForProperty( context.getComposite(), property, Text.class );

		}


If somebody knows better way to do it please post a reply.

~Kamesh
Re: Underlying Control [message #713600 is a reply to message #713200] Mon, 08 August 2011 16:25 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 950
Registered: July 2009
Senior Member
It looks like you found the current API used for this purpose.

- Konstantin
Previous Topic:add multiple items to ModelElementList property
Next Topic:Invalid Model Path
Goto Forum:
  


Current Time: Sun Nov 23 01:19:32 GMT 2014

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

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