Tabstrip

Layouts v1 API is deprecated and no longer supported as of OpenFin 16+. Please use Platform API instead.

Index

Events

TabGroupMaximizedEvent

TabGroupMaximizedEvent:

Fired when the current tab group is maximized. See addEventListener.

import {tabstrip} from 'openfin-layouts';
import {TabGroupMaximizedEvent} from 'openfin-layouts/dist/client/tabstrip';


tabstrip.addEventListener('tab-group-maximized', (event: TabGroupMaximizedEvent) => {
    const tabGroupID = event.identity;
    console.log(`Tab group maximized: ${tabGroupID.uuid}/${tabGroupID.name}`);
});

identity

identity: WindowIdentity

Identifies the window that is the source of the current event.

type

type: "tab-group-maximized"

TabGroupMinimizedEvent

TabGroupMinimizedEvent:

Event fired whenever the current tab group is minimized. See addEventListener.

import {tabstrip} from 'openfin-layouts';
import {TabGroupMinimizedEvent} from 'openfin-layouts/dist/client/tabstrip';


tabstrip.addEventListener('tab-group-minimized', (event: TabGroupMinimizedEvent) => {
    const tabGroupID = event.identity;
    console.log(`Tab group minimized: ${tabGroupID.uuid}/${tabGroupID.name}`);
});

identity

identity: WindowIdentity

Identifies the window that is the source of the current event.

type

type: "tab-group-minimized"

TabGroupRestoredEvent

TabGroupRestoredEvent:

Fired when a tab group is restored back to normal state from being maximized or minimized. See addEventListener.

import {tabstrip} from 'openfin-layouts';
import {TabGroupRestoredEvent} from 'openfin-layouts/dist/client/tabstrip';

tabstrip.addEventListener('tab-group-restored', (event: TabGroupRestoredEvent) => {
    const tabGroupID = event.identity;
    console.log(`Tab group restored: ${tabGroupID.uuid}/${tabGroupID.name}`);
});

identity

identity: WindowIdentity

Identifies the window that is the source of the current event.

type

type: "tab-group-restored"

Functions

addEventListener

  • addEventListener(eventType: "tab-group-restored", listener: function): void
  • addEventListener(eventType: "tab-group-minimized", listener: function): void
  • addEventListener(eventType: "tab-group-maximized", listener: function): void

endDrag

  • endDrag(): Promise<void>
  • Informs the layouts service a tab HTML5 drag sequence has ended. Required at the end of any tabstrip drag operation. Only one dragging operation should ever be taking place.

    import {tabstrip} from 'openfin-layouts';
    
    window.document.body.addEventListener("dragend", (event) => {
         tabstrip.endDrag();
    })

    Returns Promise<void>

removeEventListener

  • removeEventListener(eventType: "tab-group-restored", listener: function): void
  • removeEventListener(eventType: "tab-group-minimized", listener: function): void
  • removeEventListener(eventType: "tab-group-maximized", listener: function): void

reorderTabs

  • reorderTabs(newOrder: Identity[]): Promise<void>
  • Updates the layouts service provider with the new order of tabs in a tabstrip. Required for workspace restore operations to restore the tabs in the correct order.

    This call is purely informational and will not trigger any events.

    The length of the provided array must match the current number of tabs, and each current tab must appear in the array exactly once to be valid.

    import {tabstrip} from 'openfin-layouts';
    
    const tabs = [{uuid: 'App0', name: 'App0'}, {uuid: 'App1', name: 'App1'}, {uuid: 'App2', name: 'App2'}];
    
    tabstrip.reorderTabs(tabs);
    throws

    Error: If the provided value is not an array.

    throws

    Error: If array item type identity is not a valid Identity.

    throws

    Error: If not all tabs present in the tabstrip are in the provided array.

    throws

    Error: If array item is not in the calling tab group.

    Parameters

    • newOrder: Identity[]

      The new order of the tabs. First index in the array will match the first tab in the strip.

    Returns Promise<void>

startDrag

  • startDrag(identity: Identity): Promise<void>
  • Informs the layouts service a tab HTML5 drag sequence has begun. Required at the beginning of any tabstrip drag operation. Only one dragging operation should ever be taking place.

    import {tabstrip} from 'openfin-layouts';
    
    window.document.body.addEventListener("dragstart", (event) => {
         tabstrip.startDrag({uuid: 'App0', name: 'App0'});
    });
    throws

    Error: If identity is not a valid Identity.

    Parameters

    • identity: Identity

      The identity of the tab which is being dragged.

    Returns Promise<void>