|Re: Convert a set of plugin projects to a minimal Eclipse 4 RCP [message #1699501 is a reply to message #1699262]
||Wed, 24 June 2015 15:48
| Alexander Baier
Registered: May 2015
Dirk Fauth wrote on Tue, 23 June 2015 06:57|
I'm not sure about the question.
First, in E4 you do almost everything via injection. For the EPartService it is typically fine to do a field injection.
Ok, I will go down this route then. I was wondering, if there is some kind of lifecycle I have to be careful about, when working with the EPartService. E.g. does the service injected at object creation time (constructor, field) behave different than one, that is injected on a method call. Or, more to the point of my example, is it safe to use a PartService injected via the constructor after the constructor has finished executing.
Second, if you need to programmatically perform actions on the application model, you need to use the eclipse 4 services. Since you want to show different views dependent on your selection, IMHO using the EPartService is the correct way. If you only need to change the content of a view, you could give the ESelectionService a try.
I actually want to use multiple instances of the same view. How do I do that? Can I just call EPartService.createPart(String) multiple times? If yes, is there a build-in mechanism allowing me to differentiate between these multiple instances, or do I have to do my own book keeping?
Powered by FUDForum
. Page generated in 0.04997 seconds