Contributing new retargetable actions
The workbench is not the only plug-in that can create retargetable
actions. Your plug-in can define its own retargetable action, so that
views and editors within your plug-in can share the same menu actions.
There are two ways to contribute retargetable actions from your plug-in:
- An editor can define a retargetable action for which the editor and
related views can hook handlers. The action is only available in the
menu bar when the editor is open.
- An action set can define a retargetable action for which editors
and views can hook handlers. The action will be visible as long as the
action set is visible, but it will only be enabled if the active part has
hooked a handler for the action.
This mechanism is useful for providing tight integration between editors and
related views. For example, a content outline view can implement a handler
for an action defined by its associated editor.
The
readmetool example demonstrates both of these techniques.