简体   繁体   中英

Menu contribution in pure e4 eclipse plugin

I am writing an eclipse plugin and I want to stick to the e4 programming model as far as possible. First thing I want to do are menu and toolbar contributions but I am already stuck. I defined an extension in my plugin.xml :

<extension id="sampleid1" point="org.eclipse.e4.workbench.model">
    <fragment apply="always" uri="xmi/myplugin.e4xmi" />
</extension>

Inisde the myplugin.e4xmi I tried to define both a menu as well as a menuContribution fragment along with a command and a handler fragment, but everything leads to the following log output:

!ENTRY org.eclipse.e4.ui.workbench 1 0 2014-08-25 09:22:41.476
!MESSAGE Nothing to merge for "platform:/plugin/net.mysample/xmi/myplugin.e4xmi"

Am I missing something? Or is it not yet possible to write pure e4 plugins for the eclipse IDE? If so, what parts of e4 should I use, where should I stick to 3.x API? I already implemented some views and found the injection based programming quite comfortable.

This could be related with bug 376486 :

[Model] Eclipse 4 IDE not extendable via fragments or processors

Currently the Eclipse 4.2 IDE cannot be extended via fragments or processors which makes it difficult for Eclipse plug-in projects to use the new programming model.

This is due to the fact that the processing of fragments and processors is done bevor the compatibility layer, eg the conversion of plugin.xml to the model is not done and therefore these elements cannot get extended.


This thread illustrated the same issue:

Fragments are not yet supported in combination with the compatibility layer.
The reason for that is the order of initialization.
The compatiblity extension points (such as "views") in Luna will support to add pure e4 views, though .

But also:

so Luna has released. Is it possible to contribute toolbar with fragments via model?
I use Eclipse Luna and E4 last updates but got the same message as described by topic starter:

!ENTRY org.eclipse.e4.ui.workbench 1 0 2014-07-20 18:43:30.248
!MESSAGE Nothing to merge for "platform:/plugin/.../fragment.e4xmi"

There is a thread about a way to import e4 elements into any E3 based application to reach "true mixed mode" (ie use E4 programming model in E3 based apps like the IDE)
Project E4Examples/importworkbenchbridge .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM