Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Processors
Processors [message #888780] Mon, 18 June 2012 11:58 Go to next message
Jonas Helming is currently offline Jonas Helming
Messages: 410
Registered: July 2009
Senior Member
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 #888791 is a reply to message #888780] Mon, 18 June 2012 12:14 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5242
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 03:44 Go to previous message
Lars Vogel is currently offline Lars Vogel
Messages: 1048
Registered: July 2009
Senior Member

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

Previous Topic:DI question
Next Topic:Eclipse 4 Book Early Access Version for Kindle available
Goto Forum:
  


Current Time: Fri Jul 25 07:38:58 EDT 2014

Powered by FUDForum. Page generated in 0.02595 seconds