You don't need that anymore in your handlers @Execute method you'd write
something like this:
@Execute
public void run(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
}
Tom
Am 29.05.12 18:21, schrieb Jordan Dukadinov:
> The usage of HandlerUtil is very popular in 3.x command handlers.
>
> What happens to all these handlers if I am migrating an RCP application
> to E4? Methods like HandlerUtil.getActiveWorkbenchWindow(event) will not
> work unless the application runs in "legacy mode".
>
> Is it correct, that HandlerUtil or at least some parts of it (which
> parts?) should be considered @deprecated for clean E4 development?
Ups that's the shell so you'd probably use the active part and findout
the MWindow it is in.
Maybe a similar helper might make sense for e4 Handlers but it would
operate on the IEclipseContext.
Tom
Am 29.05.12 18:48, schrieb Tom Schindl:
> You don't need that anymore in your handlers @Execute method you'd write
> something like this:
>
> @Execute
> public void run(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
> }
>
> Tom
>
> Am 29.05.12 18:21, schrieb Jordan Dukadinov:
>> The usage of HandlerUtil is very popular in 3.x command handlers.
>>
>> What happens to all these handlers if I am migrating an RCP application
>> to E4? Methods like HandlerUtil.getActiveWorkbenchWindow(event) will not
>> work unless the application runs in "legacy mode".
>>
>> Is it correct, that HandlerUtil or at least some parts of it (which
>> parts?) should be considered @deprecated for clean E4 development?
>
Well it can't be used at all any more in a pure e4 environment because
there's no execution event passed to your handler but only the
IEclipseContext. One could talk about whether an HandlerUtil which
operates on the IEclipseContext makes sense to get added though e.g. to
ui.services (though this bundle is widget agnostic so things like Shell
can't be referenced from there!).
Tom
Am 30.05.12 10:27, schrieb Jordan Dukadinov:
> Thanks for your quick reply Tom.
> So can we make the statement that HandlerUtil should not be used at all
> with E4?
Not sure what you mean. HandlerUtil is part of org.eclipse.ui.workbench
so it implies that one runs in compat mode and there the HandlerUtil is
fully functional and so no deprecation is needed at all.
If I got Jordan's question correct he asked about pure e4 and there he's
unable to use HanderUtil because e4 handlers are DI enhanced POJOs
Tom
Am 30.05.12 10:40, schrieb Christian Campo:
> Does that mean some of the methods should get the attribute @deprecated ?
Thanks for your quick reply Tom.
So can we make the statement that HandlerUtil should not be used at all with E4?
A pure E4 app shouldn't (cannot) use anything in org.clipse.ui.*: although the E3.x bridging/compatibility layer is built on top of the E4.x layer, it makes some assumptions about the structure of the underlying E4 application model. For Eclipse 4.3 we'll be looking to see how allow E4 code to coexist with E3.x, to allow for hybrid apps, so to speak.
It would definitely be useful, however, to know of the classes and utilities you use miss from org.eclipse.ui.*. Feel free to add your candidates (and use cases too) to: