Does anyone know if it is possible to use a PartDescriptor for an MPart in a ModelFragment?
When I do so and then trace the code in the ModelServiceImpl.class the only PartDescriptors I find there are the ones defined in the main Application - no descriptors from the fragment are found.
There was a post on this in 2012 http://www.eclipse.org/forums/index.php/t/366973/ and a bugzilla bugs.eclipse.org/bugs/show_bug.cgi?id=384514. The bugzilla tracker defines the bug as fixed in Nov 2013 - with a patch to org.eclipse.e4.tools.emf.ui...SharedElementsDialog.java but I am not using SharedElementsDialog.
The problem with model fragment is that you need to know the ID of your application. If you add your part descriptor in your application model and then you extract it into a fragment you will see the application ID in the model fragment. If your fragment is dedicated to a specific application it will be ok, and by extracting the fragment it should work.
May be it would be easier to use a Processor to describe it. In this case you don't need to know the application ID. Instead of choosing 'fragment' in the extension, choose 'Processor' and bind a POJO class containing an '@Execute' method that will receive the MApplication, modelService and all stuff needed :
You can then add the part descriptor using a code like this :
I initially got this working by leaving all the model fragments (commands, handlers, menus) in the plugin, then registering PartDescriptors in the main Application.e4xmi that refernce the plugin view bundleclasses - not elegent but works.
After reading your posts, I tried extracting the part descriptor as a fragment -both into the main app and into the plugin. Neither worked.
I then tried creating a processor inside the plug-in. This method appears promising - I managed to get it add items to the menu in the main application, though there now seems to be an issue injecting a Composite into a POJO on @PostConstruct in views in the plugin.