Reputation: 9836
How do you dynamically populate the actions of a popupMenu in Eclipse.
I tried the following tutorial : http://wiki.eclipse.org/Menu_Contributions/Populating_a_dynamic_submenu without much success.
Here is my plugin.xml file
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension point="org.eclipse.ui.popupMenus">
<viewerContribution
id="org.eclipse.ui.articles.action.contribution.popup.navigator"
targetID="org.eclipse.ui.views.ResourceNavigator">
<menu
id="org.eclipse.ui.articles.action.contribution.navigator.subMenu"
label="Apply command"
path="additions">
<dynamic class="helloworld.DynamicMenu"
id="org.eclipse.ui.views.problems.groupBy.items"></dynamic>
</menu>
</viewerContribution>
</extension>
</plugin>
The problem is, nothing happens. getContributionItems from DynamicMenu doesn't get called and I don't get any error. Eclipse does warn me though that dynamic is not a legal child of menu.
I am running eclipse 3.7 and building extensions targeting the same version.
Upvotes: 0
Views: 1172
Reputation: 3621
The tutorial that you are referring to uses org.eclipse.ui.menus extension point rather than org.eclipse.ui.popupMenus. The former is replacement for the latter and should be preferred.
Upvotes: 1