Previous Topic: Add a MenuNext Topic: Define a Keyboard Shortcut


Add a Menu Item

To add an item to an existing menu, create an <item> element inside a <menu> element.

Note: The item is also added to the context menu.

Follow these steps:

  1. Open the custom-menu-config.xml file.
  2. Find the <menu> element to which you want to add items.
  3. Create new menu items using the <item> element. This element has one attribute, name, which defines the name of the menu item.
  4. Add toolbar images.
  5. Specify an action to perform
  6. (Optional) Define a keyboard shortcut.

    Note: The <item> element has several child elements that define how the item behaves. For more information, see custom-menu-config.xml File and subsequent procedures.

  7. Save the changes you have made to custom-menu-config.xml.
  8. Restart the Operations Console to view and test the new menu items.

Example: Add a New Menu Item

This example adds a menu item named Ping Local to a menu named Connections.

<menu name="Connections">
<item name="Ping Local">
  <accelerator modifiers="2">VK_I</accelerator>
  <action>
    <filter>
       <has-attribute>AttributeID.NETWORK_ADDRESS</has-attribute>
    </filter>
    <context>com.aprisma.spectrum.app.topo.client.render.ModelContext
    </context>
    <context>com.aprisma.spectrum.app.alarm.client.group.AlarmContext
    </context>
    <launch-application>
       <platform>
          <os-name>Windows 9x</os-name>
          <command>command.com /c start "Local ping {0}" cmd.exe /c 
          "ping.exe {0} &amp;&amp; pause"</command>
       </platform>
       <platform>
          <os-name>Windows</os-name>
          <command>cmd.exe /c start "Local ping {0}" cmd.exe /c "ping.exe 
          {0} &amp;&amp; pause"</command>
       </platform> 
       <platform>
          <command>/usr/dt/bin/dtterm -e ping -s {0}</command>
       </platform>
       <param>
          <attribute>AttributeID.NETWORK_ADDRESS</attribute>
       </param>
    </launch-application>
  </action>
</item>
</menu>