Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » MenuContribution not working
MenuContribution not working [message #1736349] Tue, 28 June 2016 17:16 Go to next message
Robert Onslow is currently offline Robert OnslowFriend
Messages: 27
Registered: March 2016
Junior Member
My MenuContribution defined in a fragment is not showing, so I tried a dummy MenuContribution in the main Application.e4xmi as attached

This didn't work either

I have checked the Parent-ID and can't see where the problem lies. Can anyone see where the problem is?

Thanks

Thanks

Robert
Re: MenuContribution not working [message #1736361 is a reply to message #1736349] Tue, 28 June 2016 20:10 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6349
Registered: July 2009
Senior Member
MenuContribution is a concept for the Compat-Layer and should have never
leaked to e4.

There are many replacements in e4 on JavaFX. So if you describe your
usecase we might be able to help.


Tom

On 28.06.16 19:16, Robert Onslow wrote:
> My MenuContribution defined in a fragment is not showing, so I tried a dummy MenuContribution in the main Application.e4xmi as attached
>
> This didn't work either
>
> I have checked the Parent-ID and can't see where the problem lies. Can anyone see where the problem is?
>
> Thanks
>
> Thanks
>
> Robert
>
Re: MenuContribution not working [message #1736362 is a reply to message #1736361] Tue, 28 June 2016 20:20 Go to previous messageGo to next message
Robert Onslow is currently offline Robert OnslowFriend
Messages: 27
Registered: March 2016
Junior Member
Tom

Thank you so much for your response.

I need to add a Direct Menu Item specified in a model fragment in another bundle to a menu specified in Application.e4xmi

Robert
Re: MenuContribution not working [message #1736406 is a reply to message #1736362] Wed, 29 June 2016 09:49 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 478
Registered: December 2010
Location: Germany
Senior Member
Hi Robert,

you don't need a MenuContribution to do this. You can add the DirectMenuItem directly to your menu in the fragment:

1) Add a Model Fragment
2) Enter the ID of your menu in "Extended Element ID" (or use "Find" and search for the Menu element you want to extend)
3) Enter "children" in the Feature Name
4) Add a DirectMenuItem to the list

Your fragment will look something like this:

<?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:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_blYVoKyIEeCKFuMJDXQFqw">
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_Yi6YEHl5EeGH0NZcAx6uwg" featurename="children" parentElementId="my.menu.id" positionInList="">
    <elements xsi:type="menu:DirectMenuItem" xmi:id="_LteIkD3eEeawmcVIUMHCiA" elementId="my.extended.menuitem.0"/>
  </fragments>
</fragment:ModelFragments>


Cheers,
Christoph
Re: MenuContribution not working [message #1736498 is a reply to message #1736406] Wed, 29 June 2016 20:15 Go to previous message
Robert Onslow is currently offline Robert OnslowFriend
Messages: 27
Registered: March 2016
Junior Member
Thanks Cristoph
Previous Topic:OS X bundle provided at http://efxclipse.bestsolution.at/ not working
Next Topic:Does e(fx)clipse 2.4.0 officially work with Eclipse Neon 4.6
Goto Forum:
  


Current Time: Tue Aug 22 15:03:05 GMT 2017

Powered by FUDForum. Page generated in 0.03393 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software