Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Menu Contribution appears multiple times on restart
icon14.gif  Menu Contribution appears multiple times on restart [message #892450] Thu, 28 June 2012 05:16 Go to next message
Eclipse UserFriend
Hello,

I have written a plugin that adds a menu item to my main plugin (via model contribution, model fragment)

When i start the application for the first time (new workspace), the new menu item is inserted correctly, but when i start the application again, the menu item gets insterted again. With each start the Item gets inserted one more time.

When i look at the "workbench.xmi", I see that with each start the menu item is inserted once more.

To reproduce my problem I attached a file containing 2 plugins and the feature containing both. When you run the product more than once without cleaning the workspace, the menu Item ist inserted multiple times.

Any help would be greatly appreciated.
Thanks
Marc

[Updated on: Thu, 28 June 2012 06:39] by Moderator

Re: Menu Contribution appears multiple times on restart [message #892451 is a reply to message #892450] Thu, 28 June 2012 05:26 Go to previous messageGo to next message
Eclipse UserFriend
This may be relevant: http://www.eclipse.org/forums/index.php/t/358388/
Re: Menu Contribution appears multiple times on restart [message #892455 is a reply to message #892451] Thu, 28 June 2012 05:52 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the info.
But in my case I contribute the model elements (in this case the menu item) via a static model fragment and the extension point org.eclipse.e4.worbench.model without any java code (so far)
Shouldnt the framework realize, that the model fragment is already present in the saved application model and not add it again.
Otherwise where would be the benefit of contributing to the application model via a model fragment, when i have to delete the contributed elements manually when the application exits.

Perhaps i am missing something really obvious (like some "contribute only once" setting)
Re: Menu Contribution appears multiple times on restart [message #892456 is a reply to message #892455] Thu, 28 June 2012 05:55 Go to previous messageGo to next message
Eclipse UserFriend
Are you using IDs for all your model elements? See https://bugs.eclipse.org/379216
Re: Menu Contribution appears multiple times on restart [message #892469 is a reply to message #892456] Thu, 28 June 2012 06:38 Go to previous message
Eclipse UserFriend
Thank you, It works!

When i assign an ID to my menu item, it is inserted only once.
Previous Topic:e4 Target Platform
Next Topic:Add Binding Context programmatically
Goto Forum:
  


Current Time: Wed Jul 23 07:21:39 EDT 2025

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

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

Back to the top