Search code examples
eclipseeclipse-plugine4

How to contributute an E4 MPartDescriptor to Eclipse via Fragments?


How to contributute an E4 MPartDescriptor to Eclipse Plugins via Fragments?

I'm not talking about a standalone RCP application. The question concerns plugins that contribute Part Descriptors to an Eclipse IDE plugin.


Solution

    1. Create a model fragment to contribute a part descriptor
    2. Select "Application" as container type and use org.eclipse.e4.legacy.ide.application as "Extended Element ID" for your newly created model fragment.
    3. Call your part descriptor as usual.
    MPart myPart = partService.createPart("MyPartDescriptorView");
    partService.showPart(myPart, PartState.ACTIVATE);