Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
FAQ How do I add menus to the main menu?
Menus and submenus are added to the main menu by using the org.eclipse.ui.actionSets extension point. Here is an example of a top-level menu defined by the FAQ Examples plug-in:
<menu label="FA&Q Examples" id="exampleMenu"> <separator name="exampleGroup"/> </menu>
Each menu contains one or more separator elements that define groups within that menu. The menu ID, along with the separator name, is used by actions contributing to that menu. If you want to create a submenu, you also need to define a path attribute that specifies what menu and group your menu should appear under. This path attribute has the same syntax as the menubarPath attribute on action definitions. To add a submenu to the menu defined earlier, you would add the following attribute:
path="exampleMenu/exampleGroup"
To add a submenu to the File menu after the New submenu, the path would be:
path="file/new.ext"
The syntax of menu paths is described in more detail in FAQ 223.
See Also:
FAQ_How_do_I_add_actions_to_the_main_menu?
FAQ_Where_can_I_find_a_list_of_existing_action_group_names?
This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.