Handler activation [message #925202] |
Thu, 27 September 2012 13:44 |
|
Hi,
In e3 we have the concept of activeWhen and enabledWhen for handlers. How does this translate to e4?
In e4 we have the "visible when" attribute in the application model. Does that translate to the old activeWhen expression?
Then there is the @CanExecute annotation for handlers. I guess this translates to enabledWhen?
This then also means that handlers must be instantiated to find out if they can be enabled, right? There is no lazy enabledWhen any more like we use to have with core expressions?
Thanks for clarifying,
Best regards,
Wim Jongman
|
|
|
|
Re: Handler activation [message #928573 is a reply to message #928568] |
Sun, 30 September 2012 19:26 |
Eclipse User |
|
|
|
I think handler contribution classes (handler POJOS) are instantiated initiated upfront (from the call to E4Worbench.processHirerarchy) so I'm not sure there is a way of lazy-creating them.
|
|
|
Re: Handler activation [message #929732 is a reply to message #928573] |
Mon, 01 October 2012 18:08 |
Eclipse User |
|
|
|
With E3.x, the handlers were in a flat global namespace, and so the activeWhen expressions were to figure out the most specific handler for the current situation (e.g., active when the activePartId = xxx).
With E4.x, handlers can be installed on parts, windows, as well as globally on the MApplication. Handler look up starts from the active part and proceeds upwards. So many of the uses for the activeWhen expressions disappeared.
Personally, I'm not too saddened to see the disappearance of lazy instantiation -- it's caused my projects more trouble than it's saved. But I can see the usefulness of supporting enablement expressions: they allow reusing the same handler implementation in other circumstances.
Brian.
|
|
|
|
|
|
Re: Handler activation [message #1696402 is a reply to message #929732] |
Tue, 26 May 2015 10:02 |
Jonas Helming Messages: 699 Registered: July 2009 |
Senior Member |
|
|
Hi,
as it seems, the support for activeWhen has been replaced by the context
of the respective handler (a nice solution). However, there is currently
no way activate a handler based on the curretn perspective. Am I missing
something? If not, I would open up a BR for that.
Best regards
Jonas
Am 01.10.2012 um 20:08 schrieb Brian de Alwis:
> With E3.x, the handlers were in a flat global namespace, and so the
> activeWhen expressions were to figure out the most specific handler for
> the current situation (e.g., active when the activePartId = xxx).
>
> With E4.x, handlers can be installed on parts, windows, as well as
> globally on the MApplication. Handler look up starts from the active
> part and proceeds upwards. So many of the uses for the activeWhen
> expressions disappeared.
>
> Personally, I'm not too saddened to see the disappearance of lazy
> instantiation -- it's caused my projects more trouble than it's saved.
> But I can see the usefulness of supporting enablement expressions: they
> allow reusing the same handler implementation in other circumstances.
>
> Brian.
--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04156 seconds