6. menu

<menu
  name = NMTOKEN
  label = non empty token
  helpId = NMTOKEN
>
  Content: ([ insert | action | menu | separator ]+ [ menuItems ]?)
           | 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. The reference to the menuItems element, if any, must always be the last reference contained in the menu element.

The insert child element may be used to extend the previous declaration of the menu. Without an insert child element, a new declaration for menu "foo" is understood as being a redefinition of menu "foo". The insert child element specifies where to insert the items found in the previous declaration. The insert element must be the first or the last child of a menu.

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.

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="addViewAction" />
    <action name="closeViewAction" />
    <menuItems name="setStyleSheetMenuItems" />
  </menu>