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

    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 (View Summary)

    Index

    Constructors

    Properties

    _tabBar?: TabBar<Widget>
    closeIconSelector: ".lm-TabBar-tabCloseIcon"

    A selector which matches the close icon node in a tab.

    commandService?: CommandService
    contextKeyService?: ContextKeyService
    contextMenuPath?: MenuPath

    The menu path used to render the context menu.

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

    Accessors

    Methods

    • Create the class name for the tab icon.

      Parameters

      Returns string

      The full class name for the tab icon.

    • Create the ARIA attributes for a tab.

      Parameters

      Returns ElementARIAAttrs | ElementBaseAttrs

      The ARIA attributes for the tab.

    • Create the dataset for a tab.

      Parameters

      Returns ElementDataset

      The dataset for the tab.

    • Generate ID for an entry in the tab bar

      Parameters

      • title: Title<Widget>

        Title of the widget controlled by this tab bar

      • isPartOfHiddenTabBar: boolean = false

        Tells us if this entry is part of the hidden horizontal tab bar. If yes, add a suffix to differentiate it's ID from the entry in the visible tab bar

      Returns string

      DOM element ID

    • Create a unique render key for the tab.

      Parameters

      Returns string

      The unique render key for the tab.

      This method caches the key against the tab title the first time the key is generated. This enables efficient rendering of moved tabs and avoids subtle hover style artifacts.

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

    • Get the class of an icon.

      Parameters

      • iconName: string | string[]

        The name of the icon.

      • additionalClasses: string[] = []

        Additional classes of the icon.

      Returns string

    • Render the close icon element for a tab.

      Parameters

      Returns VirtualElement

      A virtual element representing the tab close icon.

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

      • OptionalisInSidePanel: 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.

      • OptionalisInSidePanel: boolean

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

      • OptionalisPartOfHiddenTabBar: boolean

        An optional check which determines if the tab is in the hidden horizontal tab bar.

      Returns VirtualElement

      The virtual element of the rendered tab.