Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] Programmatically adding a command to a tool item

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  J

 

CU soon,

 

Kai

 

From: e4-dev-bounces@xxxxxxxxxxx [mailto:e4-dev-bounces@xxxxxxxxxxx] 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 <kai.toedter@xxxxxxxxxxx> 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


Back to the top