Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ApplicationShell

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

Hierarchy

  • Widget
    • ApplicationShell

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

_mainPanelRenderer: DockPanelRenderer
activationTimeout: 2000 = 2000
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)

Type declaration

dragState?: WidgetDragState
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.

onDidAddWidget: Event<Widget> = ...
onDidAddWidgetEmitter: Emitter<Widget> = ...
onDidChangeActiveWidget: Event<IChangedArgs<Widget>> = ...
onDidChangeActiveWidgetEmitter: Emitter<IChangedArgs<Widget>> = ...
onDidChangeCurrentWidget: Event<IChangedArgs<Widget>> = ...
onDidChangeCurrentWidgetEmitter: Emitter<IChangedArgs<Widget>> = ...
onDidRemoveWidget: Event<Widget> = ...
onDidRemoveWidgetEmitter: Emitter<Widget> = ...
openerService: OpenerService

General options for the application shell.

rightPanelHandler: SidePanelHandler

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

saveResourceService: SaveResourceService
secondaryWindowHandler: SecondaryWindowHandler
sidePanelHandlerFactory: (() => SidePanelHandler)

Type declaration

splitPositionHandler: SplitPositionHandler
statusBar: StatusBarImpl
toDisposeOnActivationCheck: DisposableCollection = ...
toDisposeOnActiveChanged: DisposableCollection = ...
topPanel: Panel

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

tracker: FocusTracker<Widget> = ...

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>[]
  • get bottomAreaTabBars(): TabBar<Widget>[]
  • get currentTabArea(): undefined | Area
  • get currentTabBar(): undefined | TabBar<Widget>
  • get currentWidget(): undefined | Widget
  • get mainAreaTabBars(): TabBar<Widget>[]
  • get pendingUpdates(): Promise<void>
  • get widgets(): readonly Widget[]

Methods

  • activateNextTab(): boolean
  • activateNextTabBar(current?: undefined | TabBar<Widget>): boolean
  • activateNextTabInTabBar(current?: undefined | TabBar<Widget>): boolean
  • activatePreviousTab(): boolean
  • activatePreviousTabBar(current?: undefined | TabBar<Widget>): boolean
  • activatePreviousTabInTabBar(current?: undefined | TabBar<Widget>): boolean
  • activateWidget(id: string): Promise<undefined | Widget>
  • 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

  • addAdditionalDraggedEditorUris(uris: URI[]): 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>

  • assertActivated(widget: Widget): void
  • canSave(): boolean
  • canSaveAll(): boolean
  • canToggleMaximized(widget?: undefined | Widget): boolean
  • checkActivation(widget: Widget): Widget
  • 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 of Widget does not take any focus. This method can help finding such problems by logging a warning in case a widget was explicitly activated, but did not trigger a change of the activeWidget property.

    Parameters

    • widget: Widget

    Returns Widget

  • clearAdditionalDraggedEditorUris(): void
  • closeTabs(tabBarOrArea: TabBar<Widget> | Area, filter?: ((title: Title<Widget>, index: number) => boolean)): Promise<void>
  • Close all tabs or a selection of tabs in a specific part of the application shell.

    Parameters

    • tabBarOrArea: TabBar<Widget> | Area
       Either the name of a shell area or a `TabBar` that is contained in such an area.
      
    • Optional filter: ((title: Title<Widget>, index: number) => boolean)
       If undefined, all tabs are closed; otherwise only those tabs that match the filter are closed.
      
        • (title: Title<Widget>, index: number): boolean
        • Parameters

          • title: Title<Widget>
          • index: number

          Returns boolean

    Returns Promise<void>

  • collapseBottomPanel(): Promise<void>
  • collapsePanel(area: Area): Promise<void>
  • createBoxLayout(widgets: Widget[], stretch?: number[], options?: IOptions): BoxLayout
  • createLayout(): Layout
  • createSplitLayout(widgets: Widget[], stretch?: number[], options?: Partial<IOptions>): SplitLayout
  • createTopPanel(): Panel
  • dispatchMouseMove(): void
  • doActivateWidget(id: string): undefined | Widget
  • doRevealWidget(id: string): undefined | Widget
  • expandBottomPanel(): void
  • expandPanel(area: Area): 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

  • findTabBar(event?: Event): undefined | TabBar<Widget>
  • findTargetedWidget(event?: Event): undefined | Widget
  • findTitle(tabBar: TabBar<Widget>, event?: Event): undefined | Title<Widget>
  • Finds the title widget from the tab-bar.

    Parameters

    • tabBar: TabBar<Widget>

      used for providing an array of titles.

    • Optional event: Event

    Returns undefined | Title<Widget>

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

  • findWidgetForElement(element: HTMLElement): undefined | Widget
  • 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

  • findWidgetForNode(widgetNode: HTMLElement, widget: Widget): undefined | Widget
  • fireDidAddWidget(widget: Widget): void
  • fireDidRemoveWidget(widget: Widget): void
  • getAreaFor(input: Widget | TabBar<Widget>): undefined | Area
  • getAreaPanelFor(input: Widget): undefined | DockPanel
  • getBottomPanelSize(): undefined | number
  • getCurrentWidget(area: Area): undefined | Widget
  • getDefaultBottomPanelSize(): undefined | number
  • getPinnedBottomWidgets(): boolean[]
  • getPinnedMainWidgets(): boolean[]
  • getTabBarFor(widgetOrArea: Widget | Area): undefined | TabBar<Widget>
  • getWidgetById(id: string): undefined | Widget
  • getWidgetTitles(tabBarOrArea: TabBar<Widget> | Area, filter?: ((title: Title<Widget>, index: number) => boolean)): Title<Widget>[]
  • Collects all widget titles for the given tab bar or area and optionally filters them.

    Parameters

    • tabBarOrArea: TabBar<Widget> | Area

      The tab bar or area to retrieve the widget titles for

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

      The filter to apply to the result

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

          • title: Title<Widget>
          • index: number

          Returns boolean

    Returns Title<Widget>[]

    The filtered array of widget titles or an empty array

  • getWidgets(area: Area): Widget[]
  • handleEvent(event: Event): void
  • init(): void
  • initFocusKeyContexts(): void
  • initSidebarVisibleKeyContext(): void
  • initializeShell(): void
  • isExpanded(area: Area): boolean
  • nextTabBar(current?: undefined | TabBar<Widget>): undefined | TabBar<Widget>
  • nextTabIndexInTabBar(current?: undefined | TabBar<Widget>): number
  • onActiveChanged(sender: FocusTracker<Widget>, args: IChangedArgs<Widget>): void
  • onAfterDetach(msg: Message): void
  • onBeforeAttach(msg: Message): void
  • onCurrentChanged(sender: FocusTracker<Widget>, args: IChangedArgs<Widget>): void
  • onDragEnter(__namedParameters: IDragEvent): void
  • onDragLeave(event: IDragEvent): void
  • onDragOver(event: IDragEvent): void
  • onDrop(event: IDragEvent): void
  • previousTabBar(current?: undefined | TabBar<Widget>): undefined | TabBar<Widget>
  • previousTabIndexInTabBar(current?: undefined | TabBar<Widget>): number
  • refreshBottomPanelToggleButton(): void
  • registerWithFocusTracker(data: null | ITabAreaConfig | ISplitAreaConfig | SidePanel.LayoutData): void
  • resize(size: number, area: Area): void
  • revealWidget(id: string): Promise<undefined | Widget>
  • saveTabs(tabBarOrArea: TabBar<Widget> | Area, filter?: ((title: Title<Widget>, index: number) => boolean)): void
  • setBottomPanelSize(size: number): Promise<void>
  • setTopPanelVisibility(preference: string): void
  • setZIndex(element: HTMLElement, z: null | string): void
  • toTrackedStack(id: string): Widget[]
  • 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

  • toggleMaximized(widget?: undefined | Widget): void
  • track(widget: Widget): void
  • waitForActivation(id: string): Promise<void>
  • getDraggedEditorUris(dataTransfer: DataTransfer): URI[]
  • setDraggedEditorUris(dataTransfer: DataTransfer, uris: URI[]): void