Community
Participate
Working Groups
Invalid Menu Extension (Path is invalid) error with the following sniplet from my plugin.xml. I added an "Mine" top level menu with "Launch" action in the actionSets extension; "Launch" is not specific to any particular view or editor. Then I added a "Publish" action to the CompilationUnitEditor and I would like that to show up after the "Launch" menu. It's not acceptable to duplicate the menu in the second actionSets (as suggested workaround for bug 15670) because the top level menu needs to be enabled at all times. Please suggest a workaround for this problem. <extension point="org.eclipse.ui.actionSets"> <actionSet label="My Action Set" visible="true" id="com.my.eclipse.actionSet"> <menu label="Mine" id="myMenu"> <separator name="myLaunch"> </separator> <separator name="myPublish"> </separator> </menu> <action label="Launch" icon="icons/launch.gif" tooltip="Launch" class="com.my.eclipse.actions.LaunchAction" menubarPath="myMenu/myLaunch" toolbarPath="additional" id="com.my.eclipse.actions.LaunchAction"> </action> </actionSet> </extension> <extension point="org.eclipse.ui.editorActions"> <editorContribution targetID="org.eclipse.jdt.ui.CompilationUnitEditor" id="com.my.eclipse.publishMenu"> <!-- does not work, Mine/Launch menu is disabled <menu label="Mine" id="myMenu"> <separator name="myLaunch"> </separator> <separator name="myPublish"> </separator> </menu> --> <action label="Publish" icon="icons/publish.gif" class="com.my.eclipse.actions.PublishActionPopup" tooltip="Publish" menubarPath="myMenu/myPublish" id="com.my.eclipse.actions.PublishAction"> </action> </editorContribution> </extension>
Platform UI
Can you please provide a sample plugin to reproduce this problem, and the steps to reproduce it.
No responce, closing.
Created attachment 4669 [details] Sample jar file Sorry it took me so long to create this test case. Please reopen this bug. Steps to reproduce. 1. Unzip jar file into plugin 2. Customize Perspective, make sure "My Action Set" is checked. 3. Open any java file, there should be an error message in the .log file
Reopening so as to investigate reproducable test as time permits.
If I install the plugin as you sent it (with the menu element commented out for the org.eclipse.ui.editorActions contribution extension point), and follow your steps, it works. If I uncheck the action set, then open the java editor, then I get the error message - and that makes sense since no menu element was defined. If I uncomment the menu element in the plugin.xml file, and follow your steps again, all works fine. Even if I switch to the nav view, the Mine > Launch is enabled, and Mine > Publish is disabled. The only time I got Mine > Launch to become disabled was if I open the Java editor then checked the action set. In that case, switching to the nav view caused the Mine > Launch to be disabled too. Can you confirm that my findings are the same as yours? I will investigate the issue above with Mine > Launch being disabled.
Created attachment 4840 [details] Plugin.xml see note for 5/8/2003
Yes, that's what I'm seeing too. The Mine > Launch menu should be enabled at all times. Regarding your first paragraph, the error message does not make any sense to me. If I replace the menubarPath="file/save.ext" instead of menubarPath="myMenu/myPublish", the action would work as expected. In both cases, I didn't define any menu element. This leads me to believe that I've defined an invalid menubatPath. If you use the attached plugin.xml (or just comment out action block with "Error message", and uncomment the action block with "This will work") hopefully you'll see what I'm babbling about. Thank you so much for reopening this bug. And thank you for the excellent article on "Contributing Actions to the Eclipse Workbench".
If you use "file/save.ext", that menu path already exists because the workbench predefines this group. For your "myMenu/myPublish", you need to include a menu element to define this menu path to the workbench before you can use it in the menubarPath attribute of your action. Without going into implementation detail, the main problem is with one or more plugins trying to use the same menu element. It was never designed for that but it works...almost. We (ui team) are really pushing to fix up the whole action contribution story in the 3.0 release. It will unfortunately require API/behavior changes...the battle now if whether the benefits outway the cost (i.e. broken plugins).
No further work will be done on this until decision is made on action contribution work for 3.0 plan. Impl Note: When the editor is the first to contribute the menu definition, it owns the sub menu manager. Therefore, when Nav view gets focus, the editor tells the sub menu manager to disabled itself, causing all the items to become disabled...including the items contributed by the action set.
Thank for explaination. I look forward to hear more information on the 3.0 plans.
*** Bug 98061 has been marked as a duplicate of this bug. ***
*** Bug 98912 has been marked as a duplicate of this bug. ***
*** Bug 103203 has been marked as a duplicate of this bug. ***
Moving Dougs bugs
I found what seems to be an identical problem to this. However I was able to work around it solely by changing the id of the actionSet which contributes the item to the menu.
Assigning to component owner PW
This item has been fixed/superceded by the menu contribution mechanism - bug 154130