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 09:44 Go to next message
Wim Jongman is currently offline Wim Jongman
Messages: 275
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 15:21 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 596
Registered: December 2010
Senior Member

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 15:26 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 596
Registered: December 2010
Senior Member

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 14:08 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de Alwis
Messages: 159
Registered: January 2012
Senior Member

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.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: Handler activation [message #929796 is a reply to message #928568] Mon, 01 October 2012 15:35 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 275
Registered: July 2009
Senior Member

You just created a loop ; )

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

Report message to a moderator

Re: Handler activation [message #929798 is a reply to message #929796] Mon, 01 October 2012 15:39 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 596
Registered: December 2010
Senior Member

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 18:55 Go to previous message
Wim Jongman is currently offline Wim Jongman
Messages: 275
Registered: July 2009
Senior Member

Thanks Brian.
Previous Topic:Graduate XWT
Next Topic:Can we put one component inside another XWT composite
Goto Forum:
  


Current Time: Tue Jul 22 05:24:49 EDT 2014

Powered by FUDForum. Page generated in 0.02139 seconds