Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Access to SWT Widgets in Parts at runtime
Access to SWT Widgets in Parts at runtime [message #1016830] Thu, 07 March 2013 15:26 Go to previous message
Marina Knieling is currently offline Marina Knieling
Messages: 11
Registered: February 2013
Junior Member
Hi at all,

is it possible to get access to the SWT Widgets of a Part at runtime in a Handler class?

I have a Customer View that shall act as both, view and editor. I have text fields in there and I want the text fields to be disabled / not editable by default (act as View = read-only to prevent unintentional editing) and if I invoke the "Edit Customer" command (from the main menu or context menu from view) I want the text fields in that view to be editable and in addition show a 'Save' and 'Cancel' button in that part.

I use the following code to make sure the command can be executed and the right part is active:

@CanExecute
	public boolean canEditCustomer(@Optional @Named(IServiceConstants.ACTIVE_PART) MApplicationElement part) {
		// true if Active part is of type "customerDetails"
		if (part.getElementId().equals("com.im.ticd.app.part.customerDetails"))
			return true;
		else
			return false;
	}


But how - if at all - can I get access to my text fields in that part. I cannot cast to that implementation class as it doesn't inherit from MPart, so I think accessor methods like getNameTextField() won't work.

Any ideas on how to accomplish this?

Thx, Marina
 
Read Message
Read Message
Read Message
Read Message
Previous Topic:Launching from PDE with -console
Next Topic:Keybindings in Kepler's compat layer
Goto Forum:
  


Current Time: Wed May 22 12:04:26 EDT 2013

Powered by FUDForum. Page generated in 0.05562 seconds