Previous Topic Next topic Print topic


Global Action is an Editor Action

By specifying the complex attribute ISA Editor Action, the corresponding global action acts as an editor action.

An editor action appears in the context menu of an editor if the file suffix of the opened file matches one of the modeled editor suffixes (see Global Action for information about restrictions).

Editor actions can use the editor’s context if the editor is opened by a modeled action. See Relationship: Tool has Validate Action for more information.

You can also dynamically use the user’s cursor position or text selection to add properties to the action context. To do this, model a selection property mapping. It specifies which value from the user’s editor selection (or cursor position) should be mapped to which property.

Additionally, you can configure a keyword sensitive property mapping. Keywords can be any statement of a specific programming language, such as a PL/I Include statement. Keywords can only be identified by specific keyword parsers, when the opened editor contains valid program code. The keyword parser can identify a keyword depending on the cursor position, and return its value, for example the name of the include file of a PL/I Include statement. The advantage of using keywords for selection property mappings is that you can disable the editor action if the specific keyword is not selected. Without keyword parsers, you must correctly select the desired value in the editor while the editor action always executes without any validation. 

Attribute Type Description
Editor Suffixes * String[] Blank separated list of file suffixes for which the editor action applies (case insensitive). If the action should appear in all text editors, an asterisk (*) must be used.

Example:

COBCBL

Result: The editor action appears in the context menu of any text editor for files with the suffix COB and CBL (such as MYPROG.cbl)

The default value is an asterisk (*).
Update Edit Context Boolean

Whether tools of the editor action are allowed to update the editor’s context.

If set to true, tools of the editor actions are allowed to update the editor’s context.

Note: The editor’s context is used by the save/close action. This means, if this attribute is set to true and a tool of the editor action has as output parameter a property used by the save/close action, the save/close action will use the changed value of the property.

The default value is false.

Selection Property Mapping [O] Selection Property Mapping 0..* Complex attribute that maps a specific text selection in the editor to a property. Can be used as an input parameter for tools within the action.

Attributes for the relationship: ISA Editor Actor to Selection Property Mapping

Attribute Type Description
TargetID * Property References a property to which the text selection should be mapped.
Value From Selection Specifies which value from the user’s editor selection (or cursor position) should be mapped to the property.

Valid values include:

  • SelectedText: The selected (marked) text
  • SelectedWord: The selected word (cursor position)
  • SelectedLine: The selected line (cursor position)
  • SelectedKeyword: The selected keyword (cursor position)
Keyword [D] Selection The name of the keyword that should be used for the property mapping. The selectable values for this attribute depend on the installed keyword parsers. By default, these are:
  • COBOL – COPYBOOK
  • COBOL – INCLUDE
  • PL1 - INCLUDE

Only relevant if Value From has the value SelectedKeyword.

Mandatory [D] Boolean If set to true, the editor action does not execute if the cursor is not placed on the specified keyword.

Only relevant if Value From has the value SelectedKeyword.

Previous Topic Next topic Print topic