Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TabBarRenderer

A tab bar renderer that offers a context menu. In addition, this renderer is able to set an explicit position and size on the icon and label of each tab in a side bar. This is necessary because the elements of side bar tabs are rotated using the CSS transform property, disrupting the browser's ability to arrange those elements automatically.

Hierarchy

  • Renderer
    • TabBarRenderer

Index

Constructors

Properties

_tabBar?: TabBar<Widget>
commandService?: CommandService
contextMenuPath?: MenuPath

The menu path used to render the context menu.

contextMenuRenderer?: ContextMenuRenderer
corePreferences?: CorePreferences
decorations: Map<Title<Widget>, WidgetDecoration.Data[]> = ...
decoratorService?: TabBarDecoratorService
iconThemeService?: IconThemeService
selectionService?: SelectionService
toDispose: DisposableCollection = ...
toDisposeOnTabBar: DisposableCollection = ...

Accessors

  • get tabBar(): undefined | TabBar<Widget>
  • set tabBar(tabBar: undefined | TabBar<Widget>): void

Methods

  • createTabId(title: Title<Widget>): string
  • If size information is available for the label and icon, set an explicit height on the tab. The height value also considers padding, which should be derived from CSS settings.

    Parameters

    Returns ElementInlineStyle

  • dispose(): void
  • findDuplicateLabels(titles: Title<Widget>[]): Map<string, string>
  • Find duplicate labels from the currently opened tabs in the tab bar. Return the appropriate partial paths that can distinguish the identical labels.

    E.g., a/p/index.ts => a/..., b/p/index.ts => b/...

    To prevent excessively long path displayed, show at maximum three levels from the end by default.

    Parameters

    • titles: Title<Widget>[]

      Array of titles in the current tab bar.

    Returns Map<string, string>

    A map from each tab's original path to its displayed partial path.

  • getIconClass(iconName: string | string[], additionalClasses?: string[]): string
  • handleCloseClickEvent(event: MouseEvent): void
  • handleContextMenuEvent(event: MouseEvent): void
  • handleDblClickEvent(event: MouseEvent): void
  • If size information is available for the icon, set it as inline style. Tab padding is also considered in the top position.

    Parameters

    • data: SideBarRenderData

      Data used to render the tab icon.

    • Optional isInSidePanel: boolean

      An optional check which determines if the tab is in the side-panel.

    Returns VirtualElement

  • If size information is available for the label, set it as inline style. Tab padding and icon size are also considered in the top position.

    Parameters

    • data: SideBarRenderData

      Data used to render the tab.

    • Optional isInSidePanel: boolean

      An optional check which determines if the tab is in the side-panel.

    Returns VirtualElement

    The virtual element of the rendered label.

  • Render tabs with the default DOM structure, but additionally register a context menu listener.

    Parameters

    • data: SideBarRenderData

      Data used to render the tab.

    • Optional isInSidePanel: boolean

      An optional check which determines if the tab is in the side-panel.

    Returns VirtualElement

    The virtual element of the rendered tab.

  • resetDecorations(title?: Title<Widget>): void