Actions are automatically created from the action map.
Properties
- EVENT_INVOKEStringconstant
-
Type:
- String
- PROPERTY_ENABLED_STATEStringconstant
-
Type:
- String
- PROPERTY_SELECTED_STATEStringconstant
-
Type:
- String
- PROPERTY_STRING_STATEStringconstant
-
Type:
- String
- enabledStateString
-
The enabled state of an element. Is
trueif the action is enabled,falseotherwise. Set totrueto enable the action and tofalseto disable it.Type:
- String
- iconTextStringreadonly
-
The icon text.
Type:
- String
- iconUrlObjectreadonly
-
The URLs to icons for different sizes.
Type:
- Object
Properties:
Name Type Description defaultString The default icon URL. tinyString The icon URL to the tiny icon. smallString The icon URL to the small icon. mediumString The icon URL to the medium icon. largeString The icon URL to the large icon. - idStringreadonly
-
The ID of the action.
Type:
- String
- isIgnoreReadonlyStringreadonly
-
Is
trueif the action can be used in read only areas.Type:
- String
- selectedStateString
-
The selected state of an element. Is
trueif the action is selected,falseotherwise. Set totrueto select the action and tofalseto deselect it.Type:
- String
- shortcutStringreadonly
-
The keyboard shortcut of the action.
Type:
- String
- stringStateString
-
The current string state of the action. Set this to another string state to change the current one.
Type:
- String
- titleStringreadonly
-
The title of the action.
Type:
- String
- typeStringreadonly
-
The action type.
Type:
- String
Methods
- addEventListener(type, handler)
-
Adds a listener for one of the following events:
- enabled-state: Fired when the enabled state changes. The state that indicates whether the action is currently enabled (Example: The "table-properties-dialog" action is enabled if the caret is placed inside a table).
- selected-state: Fired when the selected state changes. The state that indicates whether the action is currently selected (Example: The "align-right" action is selected when the caret is inside text that is right aligned).
- string-state: Fired when the string state changes. This state indicates the value of the action as a string (Example: The "font-size" action can have string states like "12pt", "36pt", etc.).
- actioninvoke: Fired when the action is invoked.
Parameters:
Name Type Description typeString The event type. handlerFunction The handler to be called when the event is triggered. - addInvokeListener(handler)
-
Adds a listener that is triggered when the action is invoked.
Parameters:
Name Type Description handlerFunction The handler to be called when the event is triggered. Listens to Events:
- invoke(argument, event)async
-
Invokes the action with an optional argument and trigger element.
Parameters:
Name Type Argument Description argumentString optional
The action argument. eventEvent optional
An optinal HTML DOM Event object. Fires:
- removeEventListener(type)
-
Removes all listeners of the specified type.
Parameters:
Name Type Description typeString The event type. - removeInvokeListener()
-
Removes all actioninvoke listeners.
- toggle()
-
Toggles the selected state of the action.