StaticglobalGets the global instance of the ToolsetRegistry.
The global ToolsetRegistry instance.
Registers a toolset configuration.
The toolset configuration to register.
Unregisters a toolset by its name.
The name of the toolset to unregister.
Retrieves a list of all registered toolsets.
An array of ToolsetConfig objects representing the registered toolsets.
ToolsetRegistry is a holder of toolbox configurations for the diagram editor. It allows for registering, retrieving, and unregistering toolsets based on their name. This enables the diagram system to support various toolsets and their associated configurations in a modular way.
Toolsets should be registered with a unique name (will be used as a label) that identifies the toolset. The registry can then be used to customize diagram editor instances.
The global instance of the ToolsetRegistry can be accessed via ToolsetRegistry.global, which allows for registering toolsets that are available across all diagram editor instances without explicitly passing them.
Example usage:
ToolsetRegistry.global.register({ name: 'Basic', layout: ['select', 'rectangle', 'text', 'line'] }); const defaultEditor = new DiagramEditor({ host: document.getElementById('editor') });
const bpmnToolset = new ToolsetRegistry(); bpmnToolset.register([ { name: 'Basic', layout: ['select', 'rectangle', 'text', 'line'] }, { name: 'BPMN', layout: ['task', 'event', 'gateway'] }, ])
const bpmnEditor = new DiagramEditor({ host: document.getElementById('editor'), toolsets: bpmnToolset.registeredToolsets() });