1.1. Action which is a wrapper around a command

Action which delegates its job to a command (see Chapter 6, Commands written in the Java™ programming language in XMLmind XML Editor - Commands). This command delegate is specified using the command child element.

Attributes of the command child element:


Specifies the name under which the command has been registered.

This cannot be a configuration specific command. For example, this cannot be xhtml.convertToPS, which converts XHTML documents to PostScript™ and PDF.

If the command delegate is not a built-in command, but instead, is a custom generic command specially written to be wrapped in an action, this command:

  • must be declared in this GUI specification using a command element;

  • must be referenced in the hidden child element of the layout element.


Specifies the parameter of the command delegate, if any.


Used to implement an action which acts as toggle. The command delegate is invoked with this special parameter in order to query it about its “selected” state. The command delegate is expected to return an object. The command result is converted to a string. This string is compared to the value of attribute selectedValue (by default, this value is "true"). If these strings are equal, then the command delegate is in the “selected” state. Otherwise, the command delegate is in the “unselected” state. See example below.


Used to implement an action which acts as toggle. See attribute selectedParameter for more explanations.


Specifies whether the command delegate is editing context sensitive, that is, is enabled or disabled depending on the editing context (Which node is selected? Is some text selected? etc).

The majority of commands are editing context sensitive. That's why the default value of this attribute is true.


<action name="insertAfterAction" label="Insert _After..." 
  <command name="insert" parameter="after[implicitElement]" />

Example, a action which acts as a toggle:

<action name="toggleAutoSpellCheckAction" label="_Automatic Spell Checker"
  <command name="autoSpellChecker" parameter="toggle"
            selectedParameter="isOn" selectedValue="true"
            editingContextSensitive="false" />