|
Re: Processors [message #888791 is a reply to message #888780] |
Mon, 18 June 2012 16:14 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
No the processors run on the root-context and there are not context
getting injected an MTrimmedWindow can't work any time because what
would you expect to get injected if there are multiple of them?
And no MApplication#getContext() is not expected to be filled because
your are just making up the model at the stage the processors are
running so no IEclipseContext hiearchy has been created at this point.
The context hierarchy IIRC is created by rendering engine which steps in
a lot later.
If you want to get access to elements below MApplication you'll have to
use the EModelService, traverse the model yourself or use some
EMF-technologies (OCLQuery, EMF-Query, XPath-Query, ...).
Tom
Am 18.06.12 17:58, schrieb Jonas Helming:
> Hi,
> I am trying to implement a processor.
> If I do:
>
> @Execute
> public void execute(MApplication window){
>
> the processor is called. If I do:
>
> @Execute
> public void execute(MTrimmedWindow window){
>
> The processor is not called. If I look at the MApplication in the first
> example, I can see, that there is a MTrimmedWindow in it. However, the
> context of the MApplication is null. Isnt the context and all children
> contexts supposed to be completly instanciated, when processors are
> executed?
> I am working on RC2.
> Cheers
> Jonas
|
|
|
Re: Processors [message #894693 is a reply to message #888791] |
Tue, 10 July 2012 07:44 |
|
Hi Jonas,
maybe if you specify the ID of the window this might work.
For example in Eclipse 4 Modularity - Processors I specify the menu ID as parameter in the extension point and get it injected.
I have not checked the processor code to validate if you example will work but I think it is worth a try.
Best regards, Lars
|
|
|
Powered by
FUDForum. Page generated in 0.03857 seconds