new AbstractAction(keystrokeStr)
The base class for the editor actions.
Parameters:
Name | Type | Description |
---|---|---|
keystrokeStr |
string | the string representation of the shortcut of the action. |
- Source:
Methods
-
actionPerformed(callback)
-
Abstract method that executes the action.
Parameters:
Name Type Description callback
function A function to call after the action was performed to notify the editor that the action was finished. It must be called even when the action finished with an error. - Source:
-
getDescription() → {string}
-
Returns the description for the action - usually displayed on a tooltip.
- Source:
Returns:
The description.- Type
- string
-
getDisplayName() → {string}
-
Returns the display name for the action.
- Source:
Returns:
The display name.- Type
- string
-
<protected> getLargeIcon(devicePixelRation) → {string}
-
Returns the URL of the action's large icon. The large icon should have a minimum size of 24 by 24 px for non-hidpi displays and can vary depending on the device pixel ration, the icon being used as the background of a 24 by 24 px DIV.
Parameters:
Name Type Argument Description devicePixelRation
number <optional>
the device pixel ratio. - Source:
Returns:
The icon.- Type
- string
-
getShortcut() → {string}
-
Returns the shortcut, represented as a string. E.g. "Ctrl B", "Alt Shift T". The shortcut may use platform-independent modifiers M1 to M4.
- Source:
Returns:
the string representation of the shortcut. If there is no shortcut, returns an empty string.- Type
- string
-
<protected> getSmallIcon(devicePixelRation) → {string}
-
Returns the URL of the action's small icon. The small icon should have a minimum size of 16 by 16 px for non-hidpi displays and can vary depending on the device pixel ration, the small icon being used as the background of a 16px by 16px div.
Parameters:
Name Type Argument Description devicePixelRation
number <optional>
the device pixel ratio. - Source:
Returns:
The icon.- Type
- string
-
isEnabled() → {boolean}
-
Tells whether the action is enabled.
- Source:
Returns:
Whether the action is enabled.- Type
- boolean
-
renderLargeIcon() → {Element}
-
This method renders the large icon of the action in a 24px by 24px div with the action's large icon as its background. This allows the getLargeIcon() method to return different sized icons depending on the device pixel ration, the size constraints being imposed by the enclosing DIV. It should be overridden only for custom rendering strategies, otherwise consider using the getLargeIcon method.
- Source:
Returns:
the rendering of the large icon image.- Type
- Element
-
renderSmallIcon() → {HTMLElement}
-
This method renders the small icon of the action in a 24px by 24px DIV with the action's small icon as its background, this allows the getSmallIcon() method to return different sized icons depending on the device pixel ration, the size constraints being imposed by the enclosing DIV. It should be overridden only for custom rendering strategies, otherwise consider using the getSmallIcon method.
- Source:
Returns:
the rendering of the small icon image.- Type
- HTMLElement