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

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

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _activeEditor: undefined | EditorWidget
    _currentEditor: undefined | EditorWidget
    commands: CommandService
    editorCounters: Map<string, number>
    id: string = EditorPreviewWidgetFactory.ID

    The widget open handler id.

    • 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.
    label: string
    layoutIsSet: boolean = false

    Until the layout has been restored, widget state is not reliable, so we ignore creation events.

    navigationLocationService: NavigationLocationService
    onActiveEditorChanged: Event<undefined | EditorWidget>

    Emit when the active editor is changed.

    onActiveEditorChangedEmitter: Emitter<undefined | EditorWidget>
    onCreated: Event<EditorWidget>

    Emit when a new widget is created.

    onCreatedEmitter: Emitter<EditorWidget>
    onCurrentEditorChanged: Event<undefined | EditorWidget>

    Emit when the current editor is changed.

    onCurrentEditorChangedEmitter: Emitter<undefined | EditorWidget>
    preferenceService: PreferenceService
    recentlyVisibleIds: string[]
    selectionResolvers: EditorSelectionResolver[]
    widgetManager: WidgetManager

    Accessors

    • get activeEditor(): undefined | EditorWidget

      The active editor. If there is an active editor (one that has focus), active and current are the same.

      Returns undefined | EditorWidget

    • get all(): W[]

      Retrieves all open widgets that have been opened by this handler.

      Returns W[]

      all open widgets for this open handler.

    • get currentEditor(): undefined | EditorWidget

      The most recently activated editor (which might not have the focus anymore, hence it is not active). If no editor has focus, e.g. when a context menu is shown, the active editor is undefined, but current might be the editor that was active before the menu popped up.

      Returns undefined | EditorWidget

    • get recentlyVisible(): undefined | EditorWidget

      Returns undefined | EditorWidget

    Methods

    • Test whether this handler can open the given URI for given options. Return a nonzero number if this handler can open; otherwise it cannot. Never reject.

      A returned value indicating a priority of this handler.

      Parameters

      Returns number

    • Tries to get an existing widget for the given uri.

      Parameters

      Returns Promise<undefined | EditorWidget>

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

    • Parameters

      Returns undefined | number

    • 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.

      • Optionaloptions: EditorOpenerOptions

        the widget opener options.

      Returns Promise<EditorWidget>

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

    • Parameters

      Returns string