Defining a Customized Command

You can define commands in the Customize Commands dialog box. The number of commands you can define is limited to 256.

When you define a command, the name you typed for the command is displayed as a submenu entry of the Execute Commands menu item. Command names appear alphabetically sorted.

You can define a context for that command, so it becomes diagram dependent and displays as a submenu only when it is relevant.

The following picture illustrates the result of commands definition performed in the Customize Commands dialog box.



To define a command, you have to specify the following in the Customize commands dialog box:

Command definition

Description

Name

Name of the command that is displayed as a submenu in the Execute Commands menu item. Names are unique and can contain a pick letter (&Generate Java will appear as Generate Java)

Submenu

Name of the submenu that groups commands. It is displayed in the Execute Commands menu item. You can select a default submenu from the list (<None>, Check Model, Export, Generation, Import, Reverse) or create your own submenu that will be added to the listbox. If you select <None> or leave the box empty, the command you defined will be directly added in the submenu of the Execute Commands menu item

Context

Optional information that allows the display of the command according to the opened diagram. If you do not define a context for the command, it will appear in the Execute Commands menu item whatever the opened diagram, and even when no diagram is active

Type

Type of the command that you select from the list. It can be an executable or a VB script

Command Line

Path of the command file. The Ellipsis button allows you to browse for a file or any argument. If the command file is a VB script, you can click the button in the toolbar to directly open the scripting editor and preview or edit the script

Comment

Descriptive label for the command. It is displayed in the status bar when you select a command name in the Execute Commands menu item

Show in Menu

Indicates whether the command name should be displayed in the Execute Commands menu item or not. It allows you to disable a command in the menu without deleting the command definition

Keyboard shortcut

Allows you to apply a keyboard shortcut to the command. You can select one from the list. The use of a keyboard shortcut must be unique

Context Option

The Context option allows you to define a diagram dependent command that will appear only when the parameters you declared in its definition match the current diagram.

When no matches are found, the command is unavailable.

When you click the Ellipsis button in the Context column of the Customize Commands dialog box, you open the Context Definition dialog box in which you are asked to select the following optional parameters:

Parameter

Description

Model

Allows you to select a model type from the Model list

Diagram

Allows you to select a diagram type for the selected model from the Diagram list

Target resource

Allows you to select or type a XEM file from the Target Resource list, which contains all the XEM files defined for the selected model type. The path button allows you to browse for another particular target resource (XOL, XPL, XSL or XDB) in another folder

Here are some examples of context definitions as they display in the Context column of the Customize Commands dialog box:

Context definition

Description

*/*/*

Default value. The command is displayed in the Execute Commands menu item whatever the opened diagram, and even when no diagram is active

OOM/*/*

The command is displayed in the Execute Commands menu item whenever an OOM is opened, whatever the opened diagram and the selected target resource

OOM/Class diagram/*

The command is displayed in the Execute Commands menu item whenever an OOM is opened with a class diagram, whatever the selected target resource

OOM/Class diagram/Java

The command is displayed in the Execute Commands menu item whenever an OOM is opened with a class diagram which target resource is Java

Import/Export Submenus

When you select Import or Export in the Submenu list of the Customize Commands dialog box, the command you defined is displayed not only as a submenu entry of the Execute Commands menu item of the Tools menu but also as a submenu entry of the Import or Export menu items of the File menu.

For example you defined the following command in the Customize Commands dialog box:



The command is displayed as follows in the Tools menu:



The command is displayed as follows in the File menu: