Hi Paul,

I can’t find the bug in my code right now. Adding the command to the 
application and adding the handler to the application or the window has no 
effect.
If you have 10 minutes at EclipseCon, I would appreciate if you could take a 
quick look at my code  ☺

CU soon,

Kai

From: [email protected] [mailto:[email protected]] On Behalf 
Of Paul Webster
Sent: Freitag, 23. März 2012 14:32
To: E4 Project developer mailing list
Subject: Re: [e4-dev] Programmatically adding a command to a tool item

On Fri, Mar 23, 2012 at 9:10 AM, Toedter, Kai 
<[email protected]<mailto:[email protected]>> wrote:
> I assume you are adding the command and handler to the application, right?
yes, but I was not sure if this is necessary if both command and handler are 
“local”, meaning only relevant to a dynamically created tool item.

You need to add the MCommand to the application so it gets read by the system 
(with an MCommandParameter if you want to use parameters, add the 
MCommandParameter before you add the MCommand to the application).  You need to 
either add the handler to the appropriate place in the model (the part, the 
window, or the application) *or*  use the EHandlerService from the appropriate 
place in the model to activate that handler programmatically.

Later,
PW

--
Paul Webster
Hi floor.  Make me a sammich! - GIR
_______________________________________________
e4-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/e4-dev

Reply via email to