5. menu

<menu
  name = NMTOKEN
  label = non empty token
  icon = anyURI
  helpId = NMTOKEN
  insert = non empty token
  replace = non empty token
  replaceEnd = non empty token
>
  Content: [ insert | action | menu | separator | menuItems ]*
</menu>

<insert />

<action 
  name = NMTOKEN
/>

<menu 
  name = NMTOKEN
/>

<separator />

<menuItems 
  name = NMTOKEN
/>

Specifies a menu. A menu contains references to action, menu and menuItems elements declared elsewhere in the GUI specification.

Unless the referenced menuItems element has a count attribute, the reference to the menuItems element, if any, must be the last reference contained in the menu element.

The insert child element, the insert, replace, replaceEnd attributes may be used to customize to the previous definition of a menu. More information in Customizing a composite part without redefining it from scratch.

Attributes:

name

Required. Unique name identifying the menu in this GUI specification.

label

Required unless this declaration is an extension of the previous one (that is, <insert/> is used). Label of the menu.

icon

Icon used for the menu entry when this menu is added to a parent menu. Also used for the tool bar button when this menu is added to a toolBar.

This URI may be resolved using XML catalogs.

helpId

Online help ID of the menu.

Example, an ordinary menu:

<menu name="helpMenu" label="_Help"
      helpId="helpMenu">
  <action name="helpAction" />
  <action name="contextualHelpAction" />
  <separator />
  <action name="showContentModelAction" />
  <separator />
  <action name="listBindingsAction" />
  <action name="listPluginsAction" />
  <separator />
  <action name="aboutAction" />
</menu>

Example, a menu where all items are dynamic:

<menu name="configSpecificMenu" label="XML"
      helpId="configSpecificMenu">
  <menuItems name="configSpecificMenuItems" />
</menu>

Example, a menu which has two static items followed by dynamic items:

<menu name="viewMenu" label="_View"
      helpId="viewMenu">
  <action name="redrawAction" />
  <separator />
  <action name="addViewsAction" />
  <!-- Automatic separator here -->
  <menuItems name="setStyleSheetMenuItems" />
</menu>