|
|
Re: PartDescriptor in Fragment [message #1281111 is a reply to message #1271199] |
Mon, 31 March 2014 11:24 |
|
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 :
@Execute
public void fillMyModel(MApplication application, EModelService modelService)
{
MPartDescriptor descriptor = modelService.createModelElement(MPartDescriptor.class);
descriptor.setElementId(MyPart.class.getCanonicalName());
descriptor.setLabel(partLabel);
descriptor.setCloseable(true);
String bundle = FrameworkUtil.getBundle(myPart.class).getSymbolicName();
descriptor.setContributionURI("bundleclass://" + bundle + "/" + myPart.class.getCanonicalName());
String contributorURI = "platform:/plugin/" + FrameworkUtil.getBundle(myPart.class).getSymbolicName();
descriptor.setContributorURI(contributorURI);
descriptor.setIconURI(iconPath.toString());
application.getDescriptors().add(descriptor);
}
|
|
|
|
|
Re: PartDescriptor in Fragment [message #1433127 is a reply to message #1290870] |
Sun, 28 September 2014 08:14 |
Mikhail Niedre Messages: 4 Registered: December 2012 Location: Voronezh |
Junior Member |
|
|
Don Smyth wrote on Thu, 10 April 2014 10:09I 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.
Thanks
Don
To solve this problem add as required plug-in javax.annotation, as result method marked as @PostConstruct will works.
without shit, without fun, just being a happy man.
|
|
|
Powered by
FUDForum. Page generated in 0.04021 seconds