Interface IMovableSectionDestination

Implemented by panels that can host sections moved in from another sidebar.

Register an implementation with IMovableSectionRegistry.registerTarget.

interface IMovableSectionDestination {
    accordionPanel: null | AccordionPanel;
    sections: readonly Widget[];
    addSection(widget: Widget): void;
    removeSectionWidget(widget: Widget): void;
}

Implemented by

Properties

accordionPanel: null | AccordionPanel

The AccordionPanel that wraps the hosted sections, or null if none has been created yet.

The move plugin reads this to set up drag-to-reorder handles and to access the title elements of hosted sections.

sections: readonly Widget[]

All section widgets currently hosted by this panel.

Queried by the move plugin during state restoration to find sections that were persisted as belonging to this panel. Must stay in sync with addSection and removeSectionWidget calls.

Methods

  • Insert a section widget into this panel.

    Called by the move plugin when the user selects "Move to …" from the context menu. A typical implementation calls this.addWidget(widget).

    Parameters

    • widget: Widget

      The widget detached from its source panel.

    Returns void

  • Remove a section widget that was previously added via addSection.

    Called by the move plugin when the user moves the section back to its original panel. A typical implementation sets widget.parent = null.

    Parameters

    • widget: Widget

      The widget to detach.

    Returns void