Community
Participate
Working Groups
Create a hello world plug-in called test. Make the ActionSet extension point look like: <extension point="org.eclipse.ui.actionSets"> <actionSet label="Sample Action Set One" visible="true" id="test.actionSet"> <menu label="Sample &Menu" id="sampleMenu"> <separator name="sampleGroup"> </separator> <separator name="sampleGroup2"> </separator> </menu> <menu label="Sample Menu &Two" path="sampleMenu/sampleGroup2" id="sampleMenu2"> <separator name="sampleGroup22"> </separator> </menu> <action label="&Sample Action" icon="icons/sample.gif" class="test.actions.SampleAction" tooltip="Hello, Eclipse world" menubarPath="sampleMenu/sampleGroup" id="test.actions.SampleAction"> </action> <action label="&Sample Action Two" icon="icons/sample.gif" class="test.actions.SampleAction" tooltip="Hello, Eclipse world" menubarPath="sampleMenu/sampleMenu2/sampleGroup22" id="test2.actions.SampleAction"> </action> </actionSet> </extension> This will give you a new "Sample Menu" in the main menu and a "Sample Action" item. It also has a submenu "Sample Menu Two" with a "Sample Action Two" item. Now create a second hello world plug-in called test2. We want to move the contribution of "Sample Menu Two" to this other plug-in. test ActionSet extension point now looks like: <extension point="org.eclipse.ui.actionSets"> <actionSet label="Sample Action Set One" visible="true" id="test.actionSet"> <menu label="Sample &Menu" id="sampleMenu"> <separator name="sampleGroup"> </separator> <separator name="sampleGroup2"> </separator> </menu> <action label="&Sample Action" icon="icons/sample.gif" class="test.actions.SampleAction" tooltip="Hello, Eclipse world" menubarPath="sampleMenu/sampleGroup" id="test.actions.SampleAction"> </action> </actionSet> </extension> test2 ActionSet extension point looks like: <extension point="org.eclipse.ui.actionSets"> <actionSet label="Sample Action Set Two" visible="true" id="test2.actionSet"> <menu label="Sample Menu &Two" path="sampleMenu/sampleGroup2" id="sampleMenu2"> <separator name="sampleGroup22"> </separator> </menu> <action label="&Sample Action Two" icon="icons/sample.gif" class="test2.actions.SampleAction" tooltip="Hello, Eclipse world" menubarPath="sampleMenu/sampleMenu2/sampleGroup22" id="test2.actions.SampleAction"> </action> </actionSet> </extension> When you run, you get errors: !ENTRY org.eclipse.ui 4 4 2005-08-03 13:57:43.459 !MESSAGE Invalid Menu Extension (Path is invalid): sampleMenu2 !ENTRY org.eclipse.ui 4 4 2005-08-03 13:57:43.462 !MESSAGE Invalid Menu Extension (Path is invalid): test2.actions.SampleAction If you replace the menu path with "window/additions" in test2, as in: <extension point="org.eclipse.ui.actionSets"> <actionSet label="Sample Action Set Two" visible="true" id="test2.actionSet"> <menu label="Sample Menu &Two" path="window/additions" id="sampleMenu2"> <separator name="sampleGroup22"> </separator> </menu> <action label="&Sample Action Two" icon="icons/sample.gif" class="test2.actions.SampleAction" tooltip="Hello, Eclipse world" menubarPath="window/sampleMenu2/sampleGroup22" id="test2.actions.SampleAction"> </action> </actionSet> </extension> The ActionSet works fine.
This is a question for the newsgroups.
I asked a question to eclipse.platform a week ago, no answer. I believe this is either a bug or an undocumentated limitation of ActionsSets.
"the location of the new menu starting from the root of the menu. Each token in the path must refer to an existing menu, except the last token which should represent a named group in the last menu in the path. If omitted, the new menu will be added to the additions named group of the menu." The key here is that the menu must exist. There is no dependency mechanism for action sets and we don't do automatic dependency detection. So, this leads to a situation where test2's action set can come into existence before test's action set. If this happens, then test2's action set will be found to reference a non-existent menu. You should take a look at Bug 36389, in particular Bug 36839 comment #9. Also, you might want to check out Bug 16282 comment #14, Bug 16282 comment #15 and Bug 16282 comment #16.
Okay, I've added a note to this effect in the extension point documentation.
Verified that this appears in the help.