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
true
if the action is enabled,false
otherwise. Set totrue
to enable the action and tofalse
to disable it.Type:
- String
- iconTextStringreadonly
-
The icon text.
Type:
- String
- iconUrlObjectreadonly
-
The URLs to icons for different sizes.
Type:
- Object
Properties:
Name Type Description default
String The default icon URL. tiny
String The icon URL to the tiny icon. small
String The icon URL to the small icon. medium
String The icon URL to the medium icon. large
String The icon URL to the large icon. - idStringreadonly
-
The ID of the action.
Type:
- String
- isIgnoreReadonlyStringreadonly
-
Is
true
if the action can be used in read only areas.Type:
- String
- selectedStateString
-
The selected state of an element. Is
true
if the action is selected,false
otherwise. Set totrue
to select the action and tofalse
to 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 type
String The event type. handler
Function 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 handler
Function 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 argument
String optional
The action argument. event
Event optional
An optinal HTML DOM Event object. Fires:
- removeEventListener(type)
-
Removes all listeners of the specified type.
Parameters:
Name Type Description type
String The event type. - removeInvokeListener()
-
Removes all actioninvoke listeners.
- toggle()
-
Toggles the selected state of the action.