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

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: core.State = ...

The current state of the bottom panel.

contextKeyService: ContextKeyService
corePreferences: CorePreferences
dockPanelFactory: core.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>> = ...
onDidDoubleClickMainArea: Event<void> = ...
onDidDoubleClickMainAreaEmitter: Emitter<void> = ...
onDidRemoveWidget: Event<Widget> = ...
onDidRemoveWidgetEmitter: Emitter<Widget> = ...
openerService: OpenerService
options: core.Options

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.

saveableService: SaveableService
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> = ...
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 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

Methods

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

  • 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

  • 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, index) => boolean)

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

        • (title, index): boolean
        • Parameters

          • title: Title<Widget>
          • index: number

          Returns boolean

    Returns Promise<void>

  • Create a box layout to assemble the application shell layout.

    Parameters

    • widgets: Widget[]
    • Optional stretch: number[]
    • Optional options: IOptions

    Returns BoxLayout

  • Create a split layout to assemble the application shell layout.

    Parameters

    • widgets: Widget[]
    • Optional stretch: number[]
    • Optional options: Partial<IOptions>

    Returns SplitLayout

  • This method is called after a side panel has been expanded while dragging a widget. It fires a mousemove event so that the drag overlay markers are updated correctly in all dock panels.

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

  • 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

  • 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, index) => boolean)

      The filter to apply to the result

        • (title, index): boolean
        • Parameters

          • title: Title<Widget>
          • index: number

          Returns boolean

    Returns Title<Widget>[]

    The filtered array of widget titles or an empty array

  • Return the tab bar next to the given tab bar; return the given tab bar if there is no adjacent one.

    Parameters

    • current: undefined | TabBar<Widget> = ...

    Returns undefined | TabBar<Widget>

  • Return the tab bar previous to the given tab bar; return the given tab bar if there is no adjacent one.

    Parameters

    • current: undefined | TabBar<Widget> = ...

    Returns undefined | TabBar<Widget>

  • 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

  • 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