Theia API Documentation v1.77.0
    Preparing search index...

    Offers functionality to move a widget out of the main window to a newly created window. Widgets must explicitly implement the ExtractableWidget interface to support this.

    This handler manages the opened secondary windows and sets up messaging between them and the Theia main window. In addition, it provides access to the extracted widgets and provides notifications when widgets are added to or removed from this handler.

    Index
    _widgets: Widget[] = []

    List of widgets in secondary windows.

    applicationShell: ApplicationShell
    dockPanelFactory: TheiaDockPanel.Factory
    dockPanelRendererFactory: (
        document?: Document | ShadowRoot,
    ) => DockPanelRenderer
    keybindings: KeybindingRegistry
    logger: ILogger
    messageService: MessageService
    nativeTabDragService: NativeTabDragService
    onDidAddWidget: Event<[Widget, Window]> = ...

    Subscribe to get notified when a widget is added to this handler, i.e. the widget was moved to an secondary window .

    onDidAddWidgetEmitter: Emitter<[Widget, Window]> = ...
    onDidRemoveWidget: Event<[Widget, Window]> = ...

    Subscribe to get notified when a widget is removed from this handler, i.e. the widget's window was closed or the widget was disposed.

    onDidRemoveWidgetEmitter: Emitter<[Widget, Window]> = ...
    onWillAddWidget: Event<[Widget, Window]> = ...

    Subscribe to get notified when a widget is added to this handler, i.e. the widget was moved to an secondary window .

    onWillAddWidgetEmitter: Emitter<[Widget, Window]> = ...
    onWillRemoveWidget: Event<[Widget, Window]> = ...

    Subscribe to get notified when a widget is removed from this handler, i.e. the widget's window was closed or the widget was disposed.

    onWillRemoveWidgetEmitter: Emitter<[Widget, Window]> = ...
    pendingWindows: Map<Window, SecondaryWindowHandler.LayoutData> = ...

    The secondary windows that are being restored, see setLayoutData, and have not been loaded yet. Their widgets are not tracked yet, so they are stored with the layout as they were restored.

    preferenceService: PreferenceService
    secondaryWindowService: SecondaryWindowService
    windowFocusService: WindowFocusService
    windowService: WindowService
    • Focuses the window in which a tab has been dropped and the widget of the tab. The drag started in another window, or outside of the main area, which keeps the focus otherwise.

      Parameters

      • widget: Widget
      • target: Window

      Returns void

    • Sets up message forwarding from the main window to secondary windows. Does nothing if this service has already been initialized.

      Parameters

      • shell: ApplicationShell

        The ApplicationShell that widgets will be moved out from.

      • dockPanelRendererFactory: (document?: Document | ShadowRoot) => DockPanelRenderer

        A factory function to create a DockPanelRenderer for use in secondary windows.

      Returns void

    • Moves all widgets of the given secondary window back to the main window, which closes the secondary window.

      Parameters

      • secondaryWindow: Window

        the window to move the widgets from

      Returns Promise<void>

    • Moves the given widget from its secondary window back to the main window. The secondary window is closed once it does not contain any widgets anymore.

      Parameters

      • widget: Widget

        the widget to move back

      Returns Promise<void>

    • Opens a secondary window and sets up its root widget once the window has been loaded.

      Parameters

      • widget: ExtractableWidget

        the widget the window is created for, its label is used as the window title

      • options: SecondaryWindowOptions | undefined

        the options for the created window, e.g. its bounds

      • populate: (newWindow: Window, rootWidget: SecondaryWindowDockPanelWidget) => void

        adds the widgets to the root widget of the loaded window

      • OptionalonDidFailToLoad: (newWindow: Window) => void

        called if the loaded window cannot host widgets, the window is closed then

      Returns Window | undefined

      the created window or undefined if it could not be created