Interface IToolbarWidgetRegistry

Toolbar widget registry interface

interface IToolbarWidgetRegistry {
    defaultFactory: (
        widgetFactory: string,
        widget: Widget,
        toolbarItem: IWidget,
    ) => Widget;
    factoryAdded: ISignal<IToolbarWidgetRegistry, string>;
    addFactory<T extends Widget = Widget>(
        widgetFactory: string,
        toolbarItemName: string,
        factory: (main: T) => Widget,
    ): undefined | (main: T) => Widget;
    createWidget(
        widgetFactory: string,
        widget: Widget,
        toolbarItem: IWidget,
    ): Widget;
    registerFactory<T extends Widget = Widget>(
        widgetFactory: string,
        toolbarItemName: string,
        factory: (main: T) => Widget,
    ): undefined | (main: T) => Widget;
}

Implemented by

Properties

defaultFactory: (
    widgetFactory: string,
    widget: Widget,
    toolbarItem: IWidget,
) => Widget

Default toolbar item factory

factoryAdded: ISignal<IToolbarWidgetRegistry, string>

A signal emitted when a factory widget has been added.

Methods

  • Add a new toolbar item factory

    Type Parameters

    Parameters

    • widgetFactory: string

      The widget factory name that creates the toolbar

    • toolbarItemName: string

      The unique toolbar item

    • factory: (main: T) => Widget

      The factory function that receives the widget containing the toolbar and returns the toolbar widget.

    Returns undefined | (main: T) => Widget

    The previously defined factory

  • Create a toolbar item widget

    Parameters

    • widgetFactory: string

      The widget factory name that creates the toolbar

    • widget: Widget

      The newly widget containing the toolbar

    • toolbarItem: IWidget

      The toolbar item definition

    Returns Widget

    The widget to be inserted in the toolbar.

  • Register a new toolbar item factory

    Type Parameters

    Parameters

    • widgetFactory: string

      The widget factory name that creates the toolbar

    • toolbarItemName: string

      The unique toolbar item

    • factory: (main: T) => Widget

      The factory function that receives the widget containing the toolbar and returns the toolbar widget.

    Returns undefined | (main: T) => Widget

    The previously defined factory

    since v4 use addFactory instead