Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Handler activation
Handler activation [message #925202] Thu, 27 September 2012 13:44 Go to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

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 #928568 is a reply to message #925202] Sun, 30 September 2012 19:21 Go to previous messageGo to next message
Eclipse UserFriend
For anyone having the same issue this discussion was followed up on https://bugs.eclipse.org/bugs/show_bug.cgi?id=390457
Re: Handler activation [message #928573 is a reply to message #928568] Sun, 30 September 2012 19:26 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #929796 is a reply to message #928568] Mon, 01 October 2012 19:35 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

You just created a loop ; )

[Updated on: Mon, 01 October 2012 19:35]

Report message to a moderator

Re: Handler activation [message #929798 is a reply to message #929796] Mon, 01 October 2012 19:39 Go to previous messageGo to next message
Eclipse UserFriend
Yeah I found out after I posted it that people would get confused because forums points to bug and bug to forum. That's why I decided to reply here Wink
Re: Handler activation [message #933293 is a reply to message #929732] Thu, 04 October 2012 22:55 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Thanks Brian.
Re: Handler activation [message #1696402 is a reply to message #929732] Tue, 26 May 2015 10:02 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
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/
Re: Handler activation [message #1696493 is a reply to message #1696402] Tue, 26 May 2015 17:11 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Not sure, is it possible to specify a handler for a perspective? In the application model editor it is not possible. But does the application model itself support this? From my understanding this should be the Eclipse 4 way for activating a handler on activating a perspective. Or am I missing something?
Re: Handler activation [message #1696541 is a reply to message #1696493] Wed, 27 May 2015 07:44 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
I agree and MPerspective does not implement MHandlerContainer...


Am 26.05.2015 um 19:11 schrieb Dirk Fauth:
> Not sure, is it possible to specify a handler for a perspective? In the
> application model editor it is not possible. But does the application
> model itself support this? From my understanding this should be the
> Eclipse 4 way for activating a handler on activating a perspective. Or
> am I missing something?


--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Handler activation [message #1696545 is a reply to message #1696541] Wed, 27 May 2015 08:13 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Well in that case it is worth a ticket (and a contribution) IMHO
Previous Topic:eclipse 4 Delta pack error
Next Topic:E4 Tools update site for Mars
Goto Forum:
  


Current Time: Tue Mar 19 03:07:25 GMT 2024

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

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

Back to the top