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

    The application shell manages the top-level widgets of the application. Use this class to add, remove, or activate a widget.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    activate activateNextTab activateNextTabBar activateNextTabInTabBar activatePreviousTab activatePreviousTabBar activatePreviousTabInTabBar activateWidget addAdditionalDraggedEditorUris addClass addWidget canSave canSaveAll canToggleMaximized children clearAdditionalDraggedEditorUris clearFlag close closeMany closeTabs closeWidget collapseBottomPanel collapsePanel contains createBottomPanel createBoxLayout createLayout createMainPanel createSplitLayout createTopPanel dispose doActivateWidget doInit doRevealWidget doToggleMaximized expandBottomPanel expandPanel findPanel findTabBar findTargetedWidget findTitle findWidgetForElement fireDidAddWidget fireDidRemoveWidget fit focusWindowIfApplicationFocused getAreaFor getAreaPanelFor getBottomPanelSize getCurrentWidget getDefaultBottomPanelSize getInsertionOptions getLayoutData getPinnedBottomWidgets getPinnedMainWidgets getTabBarFor getWidgetById getWidgets getWidgetTitles handleEvent handleMenuBarVisibility hasClass hide init initFocusKeyContexts initializeShell initSidebarVisibleKeyContext isExpanded nextTabBar nextTabIndexInTabBar notifyLayout onActivateRequest onAfterAttach onAfterDetach onAfterHide onAfterShow onBeforeAttach onBeforeDetach onBeforeHide onBeforeShow onChildAdded onChildRemoved onCloseRequest onDragEnter onDragLeave onDragOver onDrop onFitRequest onResize onUpdateRequest previousTabBar previousTabIndexInTabBar processMessage refreshBottomPanelToggleButton registerWithFocusTracker removeClass resize revealWidget save saveAll saveTabs setBottomPanelSize setFlag setHidden setLayoutData setTopPanelVisibility show testFlag toggleClass toggleMaximized toTrackedStack track tryShowToolbar update waitForActivation getDraggedEditorUris setDraggedEditorUris

    Constructors

    Properties

    additionalDraggedUris: undefined | URI[]
    applicationStateService: FrontendApplicationStateService
    bottomPanel: TheiaDockPanel

    The dock panel in the bottom shell area. In contrast to the main panel, the bottom panel can be collapsed and expanded.

    bottomPanelState: SidePanel.State

    The current state of the bottom panel.

    contextKeyService: ContextKeyService
    corePreferences: CorePreferences
    dockPanelFactory: TheiaDockPanel.Factory
    dockPanelRendererFactory: () => DockPanelRenderer
    initialized: Promise<void>
    initializedDeferred: Deferred<void>
    leftPanelHandler: SidePanelHandler

    Handler for the left side panel. The primary application views go here, such as the file explorer and the git view.

    mainPanel: TheiaDockPanel

    The dock panel in the main shell area. This is where editors usually go to.

    maximizedElement: HTMLElement
    node: HTMLElement

    Get the DOM node owned by the widget.

    onDidAddWidget: Event<Widget>
    onDidAddWidgetEmitter: Emitter<Widget>
    onDidChangeActiveWidget: Event<IChangedArgs<Widget>>
    onDidChangeActiveWidgetEmitter: Emitter<IChangedArgs<Widget>>
    onDidChangeCurrentWidget: Event<IChangedArgs<Widget>>
    onDidChangeCurrentWidgetEmitter: Emitter<IChangedArgs<Widget>>
    onDidDoubleClickMainArea: Event<void>
    onDidDoubleClickMainAreaEmitter: Emitter<void>
    onDidRemoveWidget: Event<Widget>
    onDidRemoveWidgetEmitter: Emitter<Widget>
    onDidToggleMaximized: Event<Widget>
    onDidToggleMaximizedEmitter: Emitter<Widget>
    openerService: OpenerService

    General options for the application shell.

    preferenceService: PreferenceService
    rightPanelHandler: SidePanelHandler

    Handler for the right side panel. The secondary application views go here, such as the outline view.

    saveableService: SaveableService
    secondaryWindowHandler: SecondaryWindowHandler
    sidePanelHandlerFactory: () => SidePanelHandler
    splitPositionHandler: SplitPositionHandler
    statusBar: StatusBarImpl
    toDisposeOnActiveChanged: DisposableCollection
    toolbar: TabBarToolbar
    toolbarFactory: () => TabBarToolbar
    toolbarPreferences: ToolbarPreferences
    topPanel: Panel

    The fixed-size panel shown on top. This one usually holds the main menu.

    unmaximize: undefined | (() => void)
    untitledResourceResolver: UntitledResourceResolver
    windowService: WindowService

    Accessors

    • get activeWidget(): undefined | Widget

      The active widget in the application shell. The active widget is the one that has focus (either the widget itself or any of its contents).

      Note: Focus is taken by a widget through the onActivateRequest method. It is up to the widget implementation which DOM element will get the focus. The default implementation does not take any focus; in that case the widget is never returned by this property.

      Returns undefined | Widget

    • get allTabBars(): TabBar<Widget>[]

      The tab bars contained in all shell areas.

      Returns TabBar<Widget>[]

    • get bottomAreaTabBars(): TabBar<Widget>[]

      The tab bars contained in the bottom shell area. If there is no widget in the bottom area, the returned array is empty.

      Returns TabBar<Widget>[]

    • get currentTabArea(): undefined | Area

      The shell area name of the currently active tab, or undefined.

      Returns undefined | Area

    • get currentTabBar(): undefined | TabBar<Widget>

      Return the tab bar that has the currently active widget, or undefined.

      Returns undefined | TabBar<Widget>

    • get currentWidget(): undefined | Widget

      The current widget in the application shell. The current widget is the last widget that was active and not yet closed. See the remarks to activeWidget on what active means.

      Returns undefined | Widget

    • get dataset(): DOMStringMap

      The dataset for the widget's DOM node.

      Returns DOMStringMap

    • get disposed(): ISignal<this, void>

      A signal emitted when the widget is disposed.

      Returns ISignal<this, void>

    • get hiddenMode(): HiddenMode

      Get the method for hiding the widget.

      Returns HiddenMode

    • set hiddenMode(value: HiddenMode): void

      Set the method for hiding the widget.

      Parameters

      Returns void

    • get id(): string

      Get the id of the widget's DOM node.

      Returns string

    • set id(value: string): void

      Set the id of the widget's DOM node.

      Parameters

      • value: string

      Returns void

    • get isAttached(): boolean

      Test whether the widget's node is attached to the DOM.

      Returns boolean

    • get isDisposed(): boolean

      Test whether the widget has been disposed.

      Returns boolean

    • get isHidden(): boolean

      Test whether the widget is explicitly hidden.

      Returns boolean

    • get isVisible(): boolean

      Test whether the widget is visible.

      A widget is visible when it is attached to the DOM, is not explicitly hidden, and has no explicitly hidden ancestors.

      Returns boolean

    • get layout(): null | Layout

      Get the layout for the widget.

      Returns null | Layout

    • set layout(value: null | Layout): void

      Set the layout for the widget.

      The layout is single-use only. It cannot be changed after the first assignment.

      The layout is disposed automatically when the widget is disposed.

      Parameters

      Returns void

    • get mainAreaTabBars(): TabBar<Widget>[]

      The tab bars contained in the main shell area. If there is no widget in the main area, the returned array is empty.

      Returns TabBar<Widget>[]

    • get mainPanelRenderer(): DockPanelRenderer

      Returns DockPanelRenderer

    • get parent(): null | Widget

      Get the parent of the widget.

      Returns null | Widget

    • set parent(value: null | Widget): void

      Set the parent of the widget.

      Children are typically added to a widget by using a layout, which means user code will not normally set the parent widget directly.

      The widget will be automatically removed from its old parent.

      This is a no-op if there is no effective parent change.

      Parameters

      Returns void

    • get pendingUpdates(): Promise<void>

      A promise that is resolved when all currently pending updates are done.

      Returns Promise<void>

    • get title(): Title<Widget>

      The title object for the widget.

      The title object is used by some container widgets when displaying the widget alongside some title, such as a tab panel or side bar.

      Since not all widgets will use the title, it is created on demand.

      The owner property of the title is set to this widget.

      Returns Title<Widget>

    • get widgets(): readonly Widget[]

      Returns a snapshot of all tracked widgets to allow async modifications.

      Returns readonly Widget[]

    Methods

    • Post an 'activate-request' message to the widget.

      This is a simple convenience method for posting the message.

      Returns void

    • Returns boolean

    • Activate a widget in the application shell. This makes the widget visible and usually also assigns focus to it.

      Note: Focus is taken by a widget through the onActivateRequest method. It is up to the widget implementation which DOM element will get the focus. The default implementation does not take any focus.

      Parameters

      • id: string

      Returns Promise<undefined | Widget>

      the activated widget if it was found

    • Add a class name to the widget's DOM node.

      Parameters

      • name: string

        The class name to add to the node.

        If the class name is already added to the node, this is a no-op.

        The class name must not contain whitespace.

      Returns void

    • Add a widget to the application shell. The given widget must have a unique id property, which will be used as the DOM id.

      Widgets are removed from the shell by calling their close or dispose methods.

      Widgets added to the top area are not tracked regarding the current and active states.

      Parameters

      Returns Promise<void>

    • Test whether the current widget is dirty.

      Returns boolean

    • Test whether there is a dirty widget.

      Returns boolean

    • Create an iterator over the widget's children.

      Returns IterableIterator<Widget>

      A new iterator over the children of the widget.

      The widget must have a populated layout in order to have children.

      If a layout is not installed, the returned iterator will be empty.

    • Clear the given widget flag.

      This will not typically be called directly by user code.

      Parameters

      Returns void

    • Send a 'close-request' message to the widget.

      This is a simple convenience method for sending the message.

      Returns void

    • Close all tabs or a selection of tabs in a specific part of the application shell.

      Parameters

      • tabBarOrArea: Area | TabBar<Widget>

        Either the name of a shell area or a TabBar that is contained in such an area.

      • Optionalfilter: (title: Title<Widget>, index: number) => boolean

        If undefined, all tabs are closed; otherwise only those tabs that match the filter are closed.

      Returns Promise<void>

    • Collapse the bottom panel. All contained widgets are hidden, but not closed. They can be restored by calling expandBottomPanel.

      Returns Promise<void>

    • Collapse the named side panel area. This makes sure that the panel is hidden, increasing the space that is available for other shell areas.

      Parameters

      Returns Promise<void>

    • Test whether a widget is a descendant of this widget.

      Parameters

      • widget: Widget

        The descendant widget of interest.

      Returns boolean

      true if the widget is a descendant, false otherwise.

    • Create the top panel, which is used to hold the main menu.

      Returns Panel

    • Dispose of the widget and its descendant widgets.

      It is unsafe to use the widget after it has been disposed.

      All calls made to this method after the first are a no-op.

      Returns void

    • Activate top-level area widget.

      Parameters

      • id: string

      Returns undefined | Widget

    • Reveal top-level area widget.

      Parameters

      • id: string

      Returns undefined | Widget

    • Expand the bottom panel. See expandPanel regarding the exact behavior.

      Returns void

    • Expand the named side panel area. This makes sure that the panel is visible, even if there are no widgets in it. If the panel is already visible, nothing happens. If the panel is currently collapsed (see collapsePanel) and it contains widgets, the widgets are revealed that were visible before it was collapsed.

      Parameters

      Returns void

    • Finds the tab-bar widget.

      Parameters

      • Optionalevent: Event

      Returns undefined | TabBar<Widget>

      the selected tab-bar, else returns the currentTabBar.

    • Parameters

      • Optionalevent: Event

      Returns undefined | Widget

      the widget whose title has been targeted by a DOM event on a tabbar, or undefined if none can be found.

    • Finds the title widget from the tab-bar.

      Parameters

      • tabBar: TabBar<Widget>

        used for providing an array of titles.

      • Optionalevent: Event

      Returns undefined | Title<Widget>

      the selected title widget, else returns the currentTitle or undefined.

    • Find the widget that contains the given HTML element. The returned widget may be one that is managed by the application shell, or one that is embedded in another widget and not directly managed by the shell, or a tab bar.

      Parameters

      • element: HTMLElement

      Returns undefined | Widget

    • Post a 'fit-request' message to the widget.

      This is a simple convenience method for posting the message.

      Returns void

    • Determine the name of the shell area where the given widget resides. The result is undefined if the widget does not reside directly in the shell.

      Parameters

      Returns undefined | Area

    • Compute the current height of the bottom panel. This implementation assumes that the container of the bottom panel is a SplitPanel.

      Returns undefined | number

    • Returns the last active widget in the given shell area.

      Parameters

      Returns undefined | Widget

    • Determine the default size to apply when the bottom panel is expanded for the first time.

      Returns undefined | number

    • Get an array corresponding to bottom panel widgets' pinned state.

      Returns boolean[]

    • Get an array corresponding to main panel widgets' pinned state.

      Returns boolean[]

    • Parameters

      • id: string

      Returns undefined | Widget

    • Collects all widget titles for the given tab bar or area and optionally filters them.

      Parameters

      • tabBarOrArea: Area | TabBar<Widget>

        The tab bar or area to retrieve the widget titles for

      • Optionalfilter: (title: Title<Widget>, index: number) => boolean

        The filter to apply to the result

      Returns Title<Widget>[]

      The filtered array of widget titles or an empty array

    • Parameters

      • event: Event

      Returns void

    • Parameters

      • newValue: string

      Returns void

    • Test whether the widget's DOM node has the given class name.

      Parameters

      • name: string

        The class name of interest.

      Returns boolean

      true if the node has the class, false otherwise.

    • Hide the widget and make it hidden to its parent widget.

      This causes the isHidden property to be true.

      If the widget is explicitly hidden, this is a no-op.

      Returns void

    • Check whether the named side panel area is expanded (returns true) or collapsed (returns false).

      Parameters

      Returns boolean

    • Invoke the message processing routine of the widget's layout.

      Parameters

      • msg: Message

        The message to dispatch to the layout.

        This is a no-op if the widget does not have a layout.

        This will not typically be called directly by user code.

      Returns void

    • A message handler invoked on an 'activate-request' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'after-attach' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'after-detach' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'after-hide' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'after-show' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'before-attach' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'before-detach' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'before-hide' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'before-show' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'child-added' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'child-removed' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on a 'close-request' message.

      The default implementation unparents or detaches the widget.

      Parameters

      Returns void

    • Parameters

      • __namedParameters: Event

      Returns void

    • Parameters

      • event: Event

      Returns void

    • Parameters

      • event: Event

      Returns void

    • Parameters

      • event: Event

      Returns void

    • A message handler invoked on a 'fit-request' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • A message handler invoked on an 'update-request' message.

      The default implementation of this handler is a no-op.

      Parameters

      Returns void

    • Process a message sent to the widget.

      Parameters

      • msg: Message

        The message sent to the widget.

        Subclasses may reimplement this method as needed.

      Returns void

    • Refresh the toggle button for the bottom panel. This implementation creates a status bar entry and refers to the command core.toggle.bottom.panel.

      Returns void

    • Remove a class name from the widget's DOM node.

      Parameters

      • name: string

        The class name to remove from the node.

        If the class name is not yet added to the node, this is a no-op.

        The class name must not contain whitespace.

      Returns void

    • Adjusts the size of the given area in the application shell.

      Parameters

      • size: number

        the desired size of the panel in pixels.

      • area: Area

        the area to resize.

      Returns void

    • Reveal a widget in the application shell. This makes the widget visible, but does not activate it.

      Parameters

      • id: string

      Returns Promise<undefined | Widget>

      the revealed widget if it was found

    • Save the current widget if it is dirty.

      Parameters

      Returns Promise<void>

    • Save all dirty widgets.

      Parameters

      Returns Promise<void>

    • Modify the height of the bottom panel. This implementation assumes that the container of the bottom panel is a SplitPanel.

      Parameters

      • size: number

      Returns Promise<void>

    • Set the given widget flag.

      This will not typically be called directly by user code.

      Parameters

      Returns void

    • Show or hide the widget according to a boolean value.

      Parameters

      • hidden: boolean

        true to hide the widget, or false to show it.

        This is a convenience method for hide() and show().

      Returns void

    • Parameters

      • preference: string

      Returns void

    • Show the widget and make it visible to its parent widget.

      This causes the isHidden property to be false.

      If the widget is not explicitly hidden, this is a no-op.

      Returns void

    • Test whether the given widget flag is set.

      This will not typically be called directly by user code.

      Parameters

      Returns boolean

    • Toggle a class name on the widget's DOM node.

      Parameters

      • name: string

        The class name to toggle on the node.

      • Optionalforce: boolean

        Whether to force add the class (true) or force remove the class (false). If not provided, the presence of the class will be toggled from its current state.

      Returns boolean

      true if the class is now present, false otherwise.

      The class name must not contain whitespace.

    • Parameters

      • id: string

      Returns Widget[]

      an array of Widgets, all of which are tracked by the focus tracker The first member of the array is the widget whose id is passed in, and the other widgets are its tracked parents in ascending order

    • Track the given widget so it is considered in the current and active state of the shell.

      Parameters

      Returns void

    • Post an 'update-request' message to the widget.

      This is a simple convenience method for posting the message.

      Returns void

    • Parameters

      • id: string

      Returns Promise<void>

    • Parameters

      • dataTransfer: DataTransfer

      Returns URI[]

    • Parameters

      • dataTransfer: DataTransfer
      • uris: URI[]

      Returns void