Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WidgetOpenHandler<W> Abstract

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

Type Parameters

Hierarchy

Implements

Index

Constructors

Properties

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.
onCreated: Event<W> = ...

Emit when a new widget is created.

onCreatedEmitter: Emitter<W> = ...
widgetManager: WidgetManager

Accessors

  • get all(): W[]

Methods

  • getByUri(uri: URI): Promise<undefined | W>
  • Tries to get an existing widget for the given uri.

    Parameters

    • uri: URI

      the uri of the widget.

    Returns Promise<undefined | W>

    a promise that resolves to the existing widget or undefined if no widget for the given uri exists.

  • getOrCreateByUri(uri: URI): 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

    • uri: URI

      uri of the widget.

    Returns Promise<W>

    a promise of the existing or newly created widget.

  • init(): void
  • 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

    • uri: URI

      the uri of the resource that should be opened.

    • Optional options: WidgetOpenerOptions

      the widget opener options.

    Returns Promise<W>

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