The Menu Module implements menus and menu-like components that are used by other modules. For example, a FeatureActions
menu is used by the FeatureDetails Module. The menu and its items are configured in the Menu Module. A menu item runs a configured command
with a configured commandParameter
as its argument.
You can configure menus in Manager. See Context Menus for more information.
Module
menus
: An array of menus that belong to one or more other modules:
id
: The menu's ID.
description
: A short description of the menu.
If your viewer is going to be available in more than one language, enter the text key that the description is assigned to. See Configure User Interface Text for more information on using text keys.
moduleId
: The ID of the module that the menu belongs to.
defaultIconUri
: The URI of the default icon for menu items.
items
: An array of menu items. Menu items have the following properties:
iconUri
: The image to display beside the menu item. The recommended image size is 24px by 24px.
text
: The text to appear on the menu item. You can use a text key or the literal text.
description
: A brief description of the menu item to appear below the text
. You can use a text key or the literal text.
command
: The command to execute when the menu item is selected.
If you set the command
property, do not set the batch
property.
commandParameter
: The parameter value to pass to the command when it runs, if it has a parameter. Parameters may either be simple strings or complex objects containing any number of parameters.
If you set the commandParameter
property, do not set the batch
property.
In the following example from the Feature Actions menu, a commandParameter
is passed into the ShowFeatureDetailsCompact
command to display feature details in the sidebar:
"command": "ShowFeatureDetailsCompact
", "commandParameter
": "{{context}}
"
The {{context}}
token is a special token that retrieves the default menu context which a menu may have. For example, the default context of the Feature Actions menu is the current feature. Therefore, the command displays feature details about the current feature.
hideOnDisable
: If this property is set to true
and the menu item's command cannot run, the menu item does not show in the menu.
If hideOnDisable
is false
and the menu item's command cannot run, the menu item shows in the menu, but it is grayed out.
batch
: An array of objects, each with three properties: an executable command, an optional command parameter, and an optional Boolean to abort the execution of further commands if a command fails to execute. This allows multiple commands to be executed in a specified order, although some commands may trigger asynchronous actions.
The following example attempts to activate the tabbed toolbar and, if successful, proceeds to greet the user with an alert:
"batch": [ { "command": "ActivateView", "commandParameter": "TabbedToolbarView", "abortBatchOnFailure": true }, { "command": "Alert", "commandParameter": "Hello!" } ]
If omitted, abortBatchOnFailure
is false
by default.
If you set the batch
property, do not set the command
or commandParameter
properties.
Views
No views
View Models
No view models