e4 compatability layer: add menu item in default file menu [message #725316] |
Wed, 14 September 2011 09:54  |
Eclipse User |
|
|
|
Hello,
I'm using e4 with the compatibility layer in order to include an EMF generated editor in a RCP application.
My product definition is based on "org.eclipse.ui.ide.workbench" application.
So when I launch my product, an current eclipse is launched containing my generated editor. It's OK.
Now, I would like to add a menu in the default "File" menu.
I added a fragment.e4xmi in my generated editor. This fragment contains:
<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_xg7kcN6wEeCXR5SkB_wTuQ">
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_34imwN6wEeCXR5SkB_wTuQ" featurename="commands" parentElementId="org.eclipse.e4.legacy.ide.application">
<elements xsi:type="commands:Command" xmi:id="_737YAN6xEeCXR5SkB_wTuQ" elementId="saveAsXML" commandName="Save as XML"/>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_RtL0EN6yEeCXR5SkB_wTuQ" featurename="handlers" parentElementId="org.eclipse.e4.legacy.ide.application">
<elements xsi:type="commands:Handler" xmi:id="_DOWzAN6yEeCXR5SkB_wTuQ" elementId="SaveAsXMLHandler" contributionURI="platform:/plugin/Camping.editor/camping.presentation.SaveXMLHandler" command="_737YAN6xEeCXR5SkB_wTuQ"/>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_YvLQIN6yEeCXR5SkB_wTuQ" featurename="children" parentElementId="file" positionInList="">
<elements xsi:type="menu:HandledMenuItem" xmi:id="_KP48EN6yEeCXR5SkB_wTuQ" elementId="saveAsXMLItem" label="Save as XML" command="_737YAN6xEeCXR5SkB_wTuQ"/>
</fragments>
</fragment:ModelFragments>
My menu doesn't appear in the File menu. D you know why ?
Thanks in advance.
|
|
|
|
|
Re: e4 compatability layer: add menu item in default file menu [message #725386 is a reply to message #725337] |
Wed, 14 September 2011 11:29  |
Eclipse User |
|
|
|
Am 14.09.11 16:42, schrieb val.dupin:
> Hi Tom,
>
> Thanks for your reply.
>
> When you said:
> "The only solution I can think of in 4.1 is to move the file-menu
> definition directly into the the base xmi and remove it from the adivsor
> or plugin.xml."
>
> You mean:
>
> 1- Create a new file-menu definition in my e4xmi definition, in other
> words my file-menu ?
yes i guess you copied the default legacy.e4xmi to your project.
>
> 2- And remove the existing file-menu from the plugin.xml placed in my
> application project ? programmatically I think ?
>
>
Yes dependending on where the file-menu entry is created. In many
RCP-Applications it is created through the ActionbarAdvisor.
Tom
|
|
|
Re: e4 compatability layer: add menu item in default file menu [message #725387 is a reply to message #725337] |
Wed, 14 September 2011 11:29  |
Eclipse User |
|
|
|
Am 14.09.11 16:42, schrieb val.dupin:
> Hi Tom,
>
> Thanks for your reply.
>
> When you said:
> "The only solution I can think of in 4.1 is to move the file-menu
> definition directly into the the base xmi and remove it from the adivsor
> or plugin.xml."
>
> You mean:
>
> 1- Create a new file-menu definition in my e4xmi definition, in other
> words my file-menu ?
yes i guess you copied the default legacy.e4xmi to your project.
>
> 2- And remove the existing file-menu from the plugin.xml placed in my
> application project ? programmatically I think ?
>
>
Yes dependending on where the file-menu entry is created. In many
RCP-Applications it is created through the ActionbarAdvisor.
Tom
|
|
|
Powered by
FUDForum. Page generated in 0.28176 seconds