Extending ECPReferenceService [message #1754206] |
Wed, 15 February 2017 05:13  |
Eclipse User |
|
|
|
Hi ,
We want to change the objects that are being displayed in the reference dialog. We have extended ECPReferenceService and attached it to "org.eclipse.emf.ecp.view.context.viewServices" extension point. We have set priority lesser than zero , but the new class's addExistingModelElements method is not getting called.
We want to know as even after setting priority lesser than zero our custom class is not getting called. Do we have to register new class at some other places.
[Updated on: Fri, 17 February 2017 01:05] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: Extending ECPReferenceService [message #1755146 is a reply to message #1755134] |
Tue, 28 February 2017 07:11  |
Eclipse User |
|
|
|
Hi,
in the example that I attached, the viewmodelservice was still registered via extension point. This worked for me and it still does in the attached example. When looking at your product config, the view model service plugin is not in there. So please check this (see also my first comment in this thread).
The registration via ServiceFactory is preferred, thats why I added an example for that. You are right, to make that work, you need to register the factory as an OSGi service. In your attached example, you have renamed/moved the component.xml after it has been created. If you do that, you need to update its entry in the MANIFEST.MF
for your example it would be:
Service-Component: OSGI-INF/org.eclipse.emf.ecp.makeithappen.modelservice.ReferenceServiceFactory.xml
There was actually a message on the console telling this (that the component.xml can not be found). Additionally there is a warning on the build.properteis, that you should include the folder OSGI-INF.
When fixing these three things in your example (adding the bundle to the product, the entry in the MANFIFEST:MF and the build.properties) the registration of the reference service works using both mechnsim, the extension point and the factory.
Best regards
Jonas
--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Powered by
FUDForum. Page generated in 0.07374 seconds