|Re: LifeCycle and EPartService Injection Problem [message #1386618 is a reply to message #1386565]
||Wed, 18 June 2014 17:52
| Luis Fernando Robledano-Esteban
Registered: February 2013
Hi Thomas, thanks for the answer.|
Well, I actually have the problem in other classes as well (those which are not parts). I just checked in the LyfeCycle manager class because was easier to test.
In the previous comments it was not said that it cannot be done
Johannes Spreemann wrote on Thu, 14 November 2013 10:39
Thank you very much. Your idea works!
I Injected the IEclipseContext in the postContextCreate and retrieved the EPartService from the context.
Besides, @PostContextCreate, doesnt it mean that everything is created already?
The curious thing is that it was working few days ago.
It seems it is randomly when is not a Part class (which are referred in the e4xmi file andtherefore I guess Eclipse Workbench knows of).
Therefore let me rephrase the question: How can I get a Part from a class which is not a Part it self?
This doesn't work:
@Inject EPartService _partservice;
MPart mpart = _epartservice.findPart("aa.bb.cc.mypart");
_epartservice.showPart(mpart, PartState.ACTIVATE); // _epartservice is null
}//- class A
Powered by FUDForum
. Page generated in 0.02710 seconds