Creates a tool palette mounted inside the given host element.
The element that will contain the tool buttons.
The diagram view whose tool selection the palette controls.
Optional layout and style configuration.
ProtectedhostProtecteddiagramProtectedconfigProtectedmanualProtectedrenderedCleans up the palette and detaches diagram listeners.
Rebuilds and re-renders the tool list from the current registry and layout.
Adds a tool entry manually, useful for custom or non-registered tools.
The tool identifier string.
Optionallabel: stringOptional display label; defaults to a prettified version of the tool name.
Removes all manually added tools and clears the rendered palette.
Swaps the underlying diagram view, for example after remounting.
The new diagram view to attach to.
Protected ReadonlyonHandles diagram tool-change events and updates the highlighted tool button.
The custom event carrying the new tool name.
ProtectedbindSubscribes to DIAGRAM_TOOL_CHANGED_EVENT on the diagram host to track active tool changes.
ProtectedunbindUnsubscribes DIAGRAM_TOOL_CHANGED_EVENT listener attached by bindDiagramEvents.
ProtectedresolveOrders the available tools according to the configured layout, inserting wildcard tools as needed.
The full list of tool identifiers to arrange.
The ordered list of tool identifiers to render.
ProtectedrenderBuilds and appends a single tool button to the palette.
The tool identifier string.
The display label and tooltip for the button.
ProtectedattachAttaches pointer-based drag-to-create behavior to a tool button. Does nothing when the tool's adapter does not produce a draft node.
The button element to instrument.
The tool identifier whose adapter supplies the draft node.
ProtectedhighlightMarks the given tool button as active and clears the active state from all others.
The tool identifier to highlight.
A toolbar component that displays a list of tools for the diagram editor. It allows users to select a tool, and the selected tool is highlighted. The component emits a 'tool-selected' event when a tool is selected. The layout of the tools can be customized via the configuration options.