Edit online

Adding Toolbar and Menu Actions

A Workspace Access plugin extension can contribute custom actions to the contextual menu, main menus, or to the general toolbars.

  • Contributing a new toolbar action:

    This sample Workspace Access plugin contributes a new toolbar called SampleWorkspaceAccessToolbarID. The java code of the sample plugin will use the toolbar components customizer API.

  • Contributing an action on the main menu:

    As exemplified in the sample plugin, the addMenuBarCustomizer API can be used either to add a new menu or to customize the existing main menu.

  • Contributing a contextual menu action:

    The same sample plugin uses the addMenusAndToolbarsContributorCustomizer API to contribute a contextual menu customizer. Such a customizer can be contributed either for the Text or Author editing modes.

Once an action is added, you can define a new shortcut key for it using the ActionProvider API. The action can use the WSEditor API to make changes to an open XML document.

The same customizer API can be used to remove actions from the main menu, toolbars, framework-specific menus, and contextual menus.