Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WidgetOpenHandler<W>

Generic base class for OpenHandlers that are opening a widget for a given URI.

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly Abstract id

id: string

The widget open handler id.

Implementation

  • A widget factory for this id should be registered.
  • Subclasses should not implement WidgetFactory to avoid exposing capabilities to create a widget outside of WidgetManager.

Readonly onCreated

onCreated: Event<W> = ...

Emit when a new widget is created.

Protected Readonly onCreatedEmitter

onCreatedEmitter: Emitter<W> = ...

Protected Readonly shell

Protected Readonly widgetManager

widgetManager: WidgetManager

Accessors

all

  • get all(): W[]

Methods

Abstract canHandle

closeAll

  • Closes all widgets that have been opened by this open handler.

    Parameters

    • Optional options: CloseOptions

      the close options that should be applied to all widgets.

    Returns Promise<W[]>

    a promise of all closed widgets that resolves after they have been closed.

Protected Abstract createWidgetOptions

Protected doOpen

getByUri

  • getByUri(uri: default): Promise<undefined | W>

getOrCreateByUri

  • getOrCreateByUri(uri: default): Promise<W>
  • Return an existing widget for the given uri or creates a new one.

    It does not open a widget, use {@link WidgetOpenHandler#open} instead.

    Parameters

    Returns Promise<W>

    a promise of the existing or newly created widget.

Protected getOrCreateWidget

Protected getWidget

Protected init

  • init(): void

open

  • Open a widget for the given uri and options. Reject if the given options are not widget options or a widget cannot be opened.

    Parameters

    Returns Promise<W>

    promise of the widget that resolves when the widget has been opened.

Protected tryGetPendingWidget