| Access to SWT Widgets in Parts at runtime [message #1016830] |
Thu, 07 March 2013 15:26  |
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
|
|
|