Use this extension point to add menu items to an existing menus that define an extension point. The com.blocks.BUserInterface.menus extension point has three configuration elements, menu, menuitem, and separator.
menuThemenuconfiguration element is used to assign a unique id to aNSMenuthis is being built. It has a singleidattribute that should either refere to a new menu that you are declaring, or to another menu declared elsewhere that you wish to extend. Themenuelement can contain bothmenuitemandseparatorelements.menuitemThemenuitemconfiguration element is used to addNSMenuItemsto a menu. This element has a number of attributes:titleThe title that will be used for theNSMenuItemidUnique id that others can use to refere to the menu item (for example when declaring insert postion you can insert relative to an already defined menu item that you refere to by id.actionThe selector action that will be sent to the menu item's target.targetThe object that will be the menu's target.keyEquivalentThe menu items key equivalent.keyEquivalentModifierMaskThe modify mask for the keyEquivalent, for exampleNSCommandKeyMask|NSAlternateKeyMask.locationThe location that this menu item should be inserted, relative to an existinggroupor menu itemidthat also exists in the menu that's being extended. For examplegroup:preferencesGroupmeans to insert in the grouppreferencesGroupwich is defined by aseparatorelement. Orafter:aboutmeans to insert the menu item after the menu item with the idabout.submenuid of the menu that should be used as a submenu of the menu item.
separatorUsed to insert a separator and declar a group id. This element can have the attributes:groupid of the group being defined.locationSame as location attributed used inmenuitemelement.
This example shows how the BPreferencesController adds a separator group and a preferences menu item to the com.blocks.BUserInterface.menus.main.application menu that's defined in BUserInterface's Plugin.xml:
<extension point="com.blocks.BUserInterface.menus" processOrder="1" >
<menu id="com.blocks.BUserInterface.menus.main.application">
<separator group="preferencesGroup" location="after:about"/>
<menuitem title="%Preferences..." id="preferences" action="showWindow:" keyEquivalent="," target="BPreferencesController sharedInstance" location="group:preferencesGroup" />
</menu>
</extension>
This example shows how to add a menu item that has a submenu, and how to add another item to that submenu:
<extension point="com.blocks.BUserInterface.menus">
<menu id="com.blocks.BUserInterface.menus.main">
<menuitem title="%ExampleMenuItem" id="exampleMenuItem" submenu="com.blocks.BUserInterface.menus.main.example" />
</menu>
<menu id="com.blocks.BUserInterface.menus.main.example">
<menuitem title="%OtherExampleMenuItem" id="otherExampleMenuItem" action="otherExampleItemAction:"/>
</menu>
</extension>