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:
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.
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} && pause"</command>
</platform>
<platform>
<os-name>Windows</os-name>
<command>cmd.exe /c start "Local ping {0}" cmd.exe /c "ping.exe
{0} && 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>
|
Copyright © 2013 CA.
All rights reserved.
|
|