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

constructor

Properties

Private Readonly activationTimeout

activationTimeout: 2000 = 2000

Readonly activeChanged

activeChanged: Signal<ApplicationShell, IChangedArgs<Widget>> = ...

A signal emitted whenever the activeWidget property is changed.

deprecated

since 0.11.0, use onDidChangeActiveWidget instead

Protected Readonly applicationStateService

applicationStateService: FrontendApplicationStateService

Readonly bottomPanel

bottomPanel: TheiaDockPanel

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

Protected Readonly bottomPanelState

bottomPanelState: State = ...

The current state of the bottom panel.

Protected Readonly contextKeyService

contextKeyService: ContextKeyService

Protected Readonly corePreferences

Readonly currentChanged

currentChanged: Signal<ApplicationShell, IChangedArgs<Widget>> = ...

A signal emitted whenever the currentWidget property is changed.

deprecated

since 0.11.0, use onDidChangeCurrentWidget instead

Protected dockPanelRendererFactory

dockPanelRendererFactory: () => DockPanelRenderer

Type declaration

Private Optional dragState

dragState: WidgetDragState

Readonly leftPanelHandler

leftPanelHandler: SidePanelHandler

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

Readonly mainPanel

mainPanel: TheiaDockPanel

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

Readonly onDidAddWidget

onDidAddWidget: Event<Widget> = ...

Protected Readonly onDidAddWidgetEmitter

onDidAddWidgetEmitter: Emitter<Widget> = ...

Readonly onDidChangeActiveWidget

onDidChangeActiveWidget: Event<IChangedArgs<Widget>> = ...

Protected Readonly onDidChangeActiveWidgetEmitter

onDidChangeActiveWidgetEmitter: Emitter<IChangedArgs<Widget>> = ...

Readonly onDidChangeCurrentWidget

onDidChangeCurrentWidget: Event<IChangedArgs<Widget>> = ...

Protected Readonly onDidChangeCurrentWidgetEmitter

onDidChangeCurrentWidgetEmitter: Emitter<IChangedArgs<Widget>> = ...

Readonly onDidRemoveWidget

onDidRemoveWidget: Event<Widget> = ...

Protected Readonly onDidRemoveWidgetEmitter

onDidRemoveWidgetEmitter: Emitter<Widget> = ...

Protected options

options: Options

General options for the application shell.

Readonly rightPanelHandler

rightPanelHandler: SidePanelHandler

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

Protected splitPositionHandler

splitPositionHandler: SplitPositionHandler

Protected Readonly statusBar

statusBar: StatusBarImpl

Private Readonly toDisposeOnActivationCheck

toDisposeOnActivationCheck: DisposableCollection = ...

Protected Readonly toDisposeOnActiveChanged

toDisposeOnActiveChanged: DisposableCollection = ...

Readonly topPanel

topPanel: Panel

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

Private Readonly tracker

tracker: FocusTracker<Widget> = ...

Accessors

activeWidget

  • 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

allTabBars

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

bottomAreaTabBars

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

currentTabArea

  • get currentTabArea(): undefined | "main" | "top" | "left" | "right" | "bottom"

currentTabBar

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

currentWidget

  • get currentWidget(): undefined | Widget

mainAreaTabBars

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

pendingUpdates

  • get pendingUpdates(): Promise<void>

widgets

  • get widgets(): readonly Widget[]

Methods

activateNextTab

  • activateNextTab(): boolean

activateNextTabBar

  • activateNextTabBar(current?: undefined | TabBar<Widget>): boolean

activateNextTabInTabBar

  • activateNextTabInTabBar(current?: undefined | TabBar<Widget>): boolean

activatePreviousTab

  • activatePreviousTab(): boolean

activatePreviousTabBar

  • activatePreviousTabBar(current?: undefined | TabBar<Widget>): boolean

activatePreviousTabInTabBar

  • activatePreviousTabInTabBar(current?: undefined | TabBar<Widget>): boolean

activateWidget

  • 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

addWidget

  • addWidget(widget: Widget, options?: Readonly<WidgetOptions>): Promise<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>

Private assertActivated

  • assertActivated(widget: Widget): void

canSave

  • canSave(): boolean

canSaveAll

  • canSaveAll(): boolean

canToggleMaximized

  • canToggleMaximized(): boolean

Private checkActivation

  • 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

closeTabs

  • closeTabs(tabBarOrArea: "main" | "top" | "left" | "right" | "bottom" | TabBar<Widget>, filter?: (title: Title<Widget>, index: number) => boolean): void
  • Close all tabs or a selection of tabs in a specific part of the application shell.

    Parameters

    • tabBarOrArea: "main" | "top" | "left" | "right" | "bottom" | TabBar<Widget>
       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 void

closeWidget

  • closeWidget(id: string, options?: CloseOptions): Promise<undefined | Widget>

Protected collapseBottomPanel

  • collapseBottomPanel(): Promise<void>

collapsePanel

  • collapsePanel(area: Area): Promise<void>

Protected createBottomPanel

Protected createBoxLayout

  • createBoxLayout(widgets: Widget[], stretch?: number[], options?: IOptions): BoxLayout

Protected createLayout

  • createLayout(): Layout

Protected createMainPanel

Protected createSplitLayout

  • createSplitLayout(widgets: Widget[], stretch?: number[], options?: Partial<IOptions>): SplitLayout

Protected createTopPanel

  • createTopPanel(): Panel

Private dispatchMouseMove

  • dispatchMouseMove(): void

Protected doActivateWidget

  • doActivateWidget(id: string): undefined | Widget

Protected doRevealWidget

  • doRevealWidget(id: string): undefined | Widget

Protected expandBottomPanel

  • expandBottomPanel(): void

expandPanel

  • 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

  • findTabBar(event?: Event): undefined | TabBar<Widget>

findTargetedWidget

  • findTargetedWidget(event?: Event): undefined | Widget

findTitle

  • 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

  • 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

Private findWidgetForNode

  • findWidgetForNode(widgetNode: HTMLElement, widget: Widget): undefined | Widget

Protected fireDidAddWidget

  • fireDidAddWidget(widget: Widget): void

Protected fireDidRemoveWidget

  • fireDidRemoveWidget(widget: Widget): void

getAreaFor

  • getAreaFor(input: Widget | TabBar<Widget>): undefined | "main" | "top" | "left" | "right" | "bottom"
  • 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

    • input: Widget | TabBar<Widget>

    Returns undefined | "main" | "top" | "left" | "right" | "bottom"

Protected getAreaPanelFor

  • getAreaPanelFor(input: Widget): undefined | DockPanel

Protected getBottomPanelSize

  • getBottomPanelSize(): undefined | number

getCurrentWidget

  • getCurrentWidget(area: Area): undefined | Widget

Protected getDefaultBottomPanelSize

  • getDefaultBottomPanelSize(): undefined | number

getLayoutData

getTabBarFor

  • getTabBarFor(widgetOrArea: Widget | "main" | "top" | "left" | "right" | "bottom"): undefined | TabBar<Widget>

getWidgetById

  • getWidgetById(id: string): undefined | Widget

getWidgets

  • getWidgets(area: Area): Widget[]

handleEvent

  • handleEvent(event: Event): void

Protected init

  • init(): void

Protected initFocusKeyContexts

  • initFocusKeyContexts(): void

Protected initSidebarVisibleKeyContext

  • initSidebarVisibleKeyContext(): void

isExpanded

  • isExpanded(area: Area): boolean

nextTabBar

  • nextTabBar(current?: undefined | TabBar<Widget>): undefined | TabBar<Widget>

nextTabIndexInTabBar

  • nextTabIndexInTabBar(current?: undefined | TabBar<Widget>): number

Private onActiveChanged

  • onActiveChanged(sender: FocusTracker<Widget>, args: IChangedArgs<Widget>): void

Protected onAfterDetach

  • onAfterDetach(msg: Message): void

Protected onBeforeAttach

  • onBeforeAttach(msg: Message): void

Private onCurrentChanged

  • onCurrentChanged(sender: FocusTracker<Widget>, args: IChangedArgs<Widget>): void

Protected onDragEnter

  • onDragEnter(__namedParameters: IDragEvent): void

Protected onDragLeave

  • onDragLeave(event: IDragEvent): void

Protected onDragOver

  • onDragOver(event: IDragEvent): void

Protected onDrop

  • onDrop(event: IDragEvent): void

previousTabBar

  • previousTabBar(current?: undefined | TabBar<Widget>): undefined | TabBar<Widget>

previousTabIndexInTabBar

  • previousTabIndexInTabBar(current?: undefined | TabBar<Widget>): number

Protected refreshBottomPanelToggleButton

  • refreshBottomPanelToggleButton(): void

Protected registerWithFocusTracker

  • registerWithFocusTracker(data: null | ITabAreaConfig | ISplitAreaConfig | LayoutData): void

resize

  • resize(size: number, area: Area): void

revealWidget

  • revealWidget(id: string): Promise<undefined | Widget>

save

saveAll

saveTabs

  • saveTabs(tabBarOrArea: "main" | "top" | "left" | "right" | "bottom" | TabBar<Widget>, filter?: (title: Title<Widget>, index: number) => boolean): void
  • Parameters

    • tabBarOrArea: "main" | "top" | "left" | "right" | "bottom" | TabBar<Widget>
    • Optional filter: (title: Title<Widget>, index: number) => boolean
        • (title: Title<Widget>, index: number): boolean
        • Parameters

          • title: Title<Widget>
          • index: number

          Returns boolean

    Returns void

Protected setBottomPanelSize

  • setBottomPanelSize(size: number): Promise<void>

setLayoutData

  • setLayoutData(layoutData: LayoutData): Promise<void>

Protected setTopPanelVisibility

  • setTopPanelVisibility(preference: string): void

Private setZIndex

  • setZIndex(element: HTMLElement, z: null | string): void

Protected toTrackedStack

  • toTrackedStack(id: string): Widget[]

toggleMaximized

  • toggleMaximized(): void

Protected track

  • track(widget: Widget): void

waitForActivation

  • waitForActivation(id: string): Promise<void>