Edit online

Adding Toolbar and Menu Actions

The framework customization can define actions that appear on a framework-specific toolbar when editing content in the Author visual editing mode.

You can use the Author Action dialog box to configure the name, description, icons, menu shortcuts, and various XPath-enabled activation operations.

You can use a variety of pre-defined operations in each activation mode to achieve various things:

  • Insert an XML fragment in the document either at the current position or at a specified offset.

  • Set an attribute with a certain value on a certain element.

  • Invoke an XSLT script using the XSLTOperation to produce an XML fragment to be inserted in the document.

  • Invoke a JavaScript function that can use the Author mode APIs to modify the document. Some samples of such operations can be found here: https://github.com/oxygenxml/javascript-sample-operations.

  • Set a CSS pseudo-class on a certain element. The pseudo-class can be matched from the CSS to style various elements differently.

You can also create custom Author mode operations by extending the AuthorOperation Java API.

Once a custom action has been created, it can be added to the main menu, toolbar, or contextual menu.