RED.events

This API can be used to register and invoke Actions in the editor. Actions are individual pieces of functionality that a user may want to trigger and can be bound to keyboard shortcuts.

RED.actions API

RED.actions.add( name, handler )

Register a new action.

The name should follow the pattern [provider]:[name-of-action]. For example core:show-debug-tab.

RED.actions.add("my-custom-tab:show-custom-tab",function() {
    RED.sidebar.show("my-custom-tab");
});

RED.actions.remove( name )

Remove a previously registered action.

RED.actions.remove("my-custom-tab:show-custom-tab")

RED.actions.invoke( name, [argsā€¦])

Invoke an action by name.

When bound to a keyboard shortcut, the handler will be invoked without any arguments. But when invoked using this API, it is possible to pass in arguments.

RED.actions.invoke("my-custom-tab:show-custom-tab")