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

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

    Hierarchy (View Summary)

    Index
    _activeEditor: EditorWidget | undefined
    _currentEditor: EditorWidget | undefined
    commands: CommandService
    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.

    logger: ILogger
    navigationLocationService: NavigationLocationService
    onActiveEditorChanged: Event<EditorWidget | undefined>

    Emit when the active editor is changed.

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

    Emit when a new widget is created.

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

    Emit when the current editor is changed.

    onCurrentEditorChangedEmitter: Emitter<EditorWidget | undefined>
    preferenceService: PreferenceService
    recentlyVisibleEditors: EditorWidget[]
    selectionResolvers: EditorSelectionResolver[]
    widgetManager: WidgetManager
    windowFocusService: WindowFocusService | undefined
    • get activeEditor(): EditorWidget | undefined

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

      Returns EditorWidget | undefined

    • 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(): EditorWidget | undefined

      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 EditorWidget | undefined

    • get recentlyVisible(): EditorWidget | undefined

      Returns EditorWidget | undefined

    • get recentlyVisibleIds(): string[]

      Returns string[]

      since 1.72.0. Use recentlyVisibleEditors instead.

    • 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<EditorWidget | undefined>

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

    • Parameters

      Returns number | undefined

    • The options to add a widget with if the opener options don't specify any: widgets are added to the main area, unless the user works in a secondary window. Then widgets that can be moved to secondary windows are added there, next to the current widget, like editors are opened in the active editor group in VS Code.

      Parameters

      • Optionalwidget: EditorWidget

        the widget to add, if known already

      Returns ApplicationShell.WidgetOptions

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