Class: ActionsManager

sync.api.ActionsManager

new ActionsManager()

Manager for the actions available for an editor.
Source:

Methods

getActionById(id) → {sync.actions.AbstractAction}

Parameters:
Name Type Description
id string The id of the action.
Source:
Returns:
The action with the given id.
Type
sync.actions.AbstractAction

invokeOperation(className, params, callback, opt_selectionopt, opt_backgroundopt)

Invokes an Author Operation asynchronously.
Parameters:
Name Type Attributes Description
className String The name of the Java class implementing the operation. It can be either an implementation of AuthorOperation or AuthorOperationWithResult. AuthorOperation has a couple of useful implementation for modifying the document structure (see subclasses of https://www.oxygenxml.com/InstData/Editor/SDK/javadoc/ro/sync/ecss/extensions/api/AuthorOperation.html). AuthorOperationWithResult can be used to pass a result back to the JS code after executing the operation on the server. If the operation is a custom one, it should implement ro.sync.ecss.extensions.api.webapp.SafeAuthorOperation in order for Web Author to allow invoking it from client-side code.
params Object An object mapping param names to parameter values.
callback function The Node-style callback to call when the operation finished executing. The callback's first argument is the error object or null; the second one is the actual result. In order to return a result from an operation one has to implement ro.sync.ecss.extensions.api.webapp.AuthorOperationWithResult .
opt_selection sync.api.Selection <optional>
The selection in whose context to execute the operation, if not passed the current selection is used.
opt_background boolean <optional>
flag indicating whether the operation is executed in the background. If true, the after the action is executed, the following happens:
  • the current user selection is not changed, even if the action explicitely moves the caret
  • the focus is not sent to the editor
Source:

refreshActionsStatus(…actionIds)

Refresh the graphical appearance of the buttons that execute the given actions to match their status:

  • enabled or not

In order to determine the new status the corresponding methods are called.

Parameters:
Name Type Attributes Description
actionIds string <repeatable>
The ids of the actions that need to be refreshed.
Source:

registerAction(id, action, shortcutopt)

Registers an action for the given id.
Parameters:
Name Type Attributes Description
id string The id of the action.
action sync.actions.AbstractAction The action to register.
shortcut * <optional>
The shortcut which invokes this action.
Source:

setActionShortcut(id, newShortcut)

Sets the shortcut for an action.
Parameters:
Name Type Description
id The ID of the action.
newShortcut The new shortcut for the action.
Source:

unregisterAction(id)

Un-registers the action with a given id.
Parameters:
Name Type Description
id string The id of the action.
Source: