Options
All
  • Public
  • Public/Protected
  • All
Menu

External module Tabbing

Index

Events

addEventListener

  • addEventListener(eventType: "tab-added", listener: function): Promise<void>
  • addEventListener(eventType: "tab-removed", listener: function): Promise<void>
  • addEventListener(eventType: "tab-activated", listener: function): Promise<void>
  • addEventListener(eventType: "tab-properties-updated", listener: function): Promise<void>
  • Event fired whenever the current window is tabbed. This event is used when adding windows to both new and existing tabsets.

    To find out which other windows are in the tabset, use the getTabs() method.

    import {tabbing} from 'openfin-layouts';
    
    tabbing.addEventListener('tab-added', async (event: TabAddedEvent) => {
        console.log("Window added to tab group: ", event.detail.identity);
        console.log("Windows in current group: ", await tabbing.getTabs());
    });

    If a window is moved from one tab group to another, this will be messaged as a tab-removed event, followed by a tab-added.

    type

    tab-added

    Parameters

    Returns Promise<void>

  • Event fired whenever the current window is removed from it's previous tabset.

    To find out which other windows are in the tabset, use the getTabs() method.

    import {tabbing} from 'openfin-layouts';
    
    tabbing.addEventListener('tab-removed', async (event: TabRemovedEvent) => {
        console.log("Window removed from tab group");
    });

    If a window is moved from one tab group to another, this will be messaged as a tab-removed event, followed by a tab-added.

    type

    tab-removed

    Parameters

    Returns Promise<void>

  • Event fired whenever the active tab within a tab group is changed.

    import {tabbing} from 'openfin-layouts';
    
    tabbing.addEventListener('tab-activated', (event: TabActivatedEvent) => {
        const activeTab = event.detail.tabID;
        console.log("Active tab:", activeTab.uuid, activeTab.name);
    });
    type

    tab-activated

    Parameters

    Returns Promise<void>

  • Event fired whenever a windows tab properties are updated.

    The event will always contain the full properties of the tab, even if only a subset of them were updated.

    import {tabbing} from 'openfin-layouts';
    
    tabbing.addEventListener('tab-properties-updated', (event: TabPropertiesUpdatedEvent) => {
        const tabID = event.detail.identity;
        const properties = event.detail.properties;
        console.log(`Properties for ${tabID.uuid}/${tabID.name} are:`, properties);
    });
    type

    tab-properties-updated

    Parameters

    Returns Promise<void>

Functions

addTab

  • addTab(targetWindow: Identity, windowToAdd?: Identity): Promise<void>
  • Adds current window context (or window specified in second arg) to the tab group of the target window (first arg).

    The added tab will be brought into focus.

    import {tabbing} from 'openfin-layouts';
    
    // Tab self to App1.
    tabbing.addTab({uuid: 'App1', name: 'App1'});
    
    // Tab App2 to App1.
    tabbing.addTab({uuid: 'App1', name: 'App1'}. {uuid: 'App2', name: 'App2'});
    throws

    Promise.reject: If the App Config does not match between the target and window to add.

    throws

    Promise.reject: If the targetWindow is not a valid Identity.

    throws

    Promise.reject: If the windowToAdd is not a valid Identity.

    throws

    Promise.reject: If identity is not an existing tab in a tabstrip.

    Parameters

    • targetWindow: Identity

      The identity of the window to create a tab group on.

    • Default value windowToAdd: Identity = getId()

      The identity of the window to add to the tab group. If no Identity is provided as an argument the current window context will be used.

    Returns Promise<void>

closeTab

  • closeTab(identity?: Identity): Promise<void>
  • Closes the tab for the window context and removes it from its associated tab group.

    import {tabbing} from 'openfin-layouts';
    
    // Closes the current window context tab.
    tabbing.closeTab();
    
    // Closes another windows context tab.
    tabbing.closeTab({uuid: 'App1', name: 'App1'});
    throws

    Promise.reject: If identity is not a valid Identity.

    throws

    Promise.reject: If identity is not an existing tab in a tabstrip.

    Parameters

    • Default value identity: Identity = getId()

      Identity of the window context to close. If no Identity is provided as an argument the current window context will be used.

    Returns Promise<void>

closeTabGroup

  • closeTabGroup(identity?: Identity): Promise<void>
  • Closes the tab group for the window context.

    import {tabbing} from 'openfin-layouts';
    
    // Closes the tab group for the current window context.
    tabbing.closeTabGroup();
    
    // Closes the tab group for another windows context.
    tabbing.closeTabGroup({uuid: 'App1', name: 'App1'});
    throws

    Promise.reject: If identity is not a valid Identity.

    throws

    Promise.reject: If identity is not an existing tab in a tabstrip.

    Parameters

    • Default value identity: Identity = getId()

      Identity of the window context to close the tab group for. If no Identity is provided as an argument the current window context will be used.

    Returns Promise<void>

createTabGroup

  • createTabGroup(windows: Identity[]): Promise<void>
  • Given a set of windows, will create a tab group construct and UI around them. The bounds and positioning of the first (applicable) window in the set will be

    used as the seed for the tab UI properties.

    import {tabbing} from 'openfin-layouts';
    
    tabbing.createTabGroup([{uuid: "App1", name: "App1"}, {uuid: "App2", name: "App2"}, {uuid: "App3", name: "App3"}]);
    throws

    Promise.reject: If no windows is not an array or less than 2 windows were provided.

    Parameters

    • windows: Identity[]

      Array of windows which will be added to the new tab group.

    Returns Promise<void>

getTabs

  • Returns array of window identity references for tabs belonging to the tab group of the provided window context.

    If no Identity is provided as an argument, the current window context will be used.

    If there is no tab group associated with the window context, will resolve to null.

    import {tabbing} from 'openfin-layouts';
    
    // Gets all tabs for the current window context.
    tabbing.getTabs();
    
    // Get all tabs for another window context.
    tabbing.getTabs({uuid: "sample-window-uuid", name: "sample-window-name"});
    throws

    Promise.reject: If identity is not a valid Identity.

    Parameters

    • Default value identity: Identity = getId()

      The window context, defaults to the current window.

    Returns Promise<WindowIdentity[] | null>

maximizeTabGroup

  • maximizeTabGroup(identity?: Identity): Promise<void>
  • Maximizes the tab group for the window context.

    import {tabbing} from 'openfin-layouts';
    
    // Minimizes the tab group for the current window context.
    tabbing.maxmimizeTabGroup();
    
    // Minimizes the tab group for another windows context.
    tabbing.maximizeTabGroup({uuid: 'App1', name: 'App1'});
    throws

    Promise.reject: If identity is not a valid Identity.

    throws

    Promise.reject: If identity is not an existing tab in a tabstrip.

    Parameters

    • Default value identity: Identity = getId()

      Identity of the window context to maximize the tab group for. If no Identity is provided as an argument the current window context will be used.

    Returns Promise<void>

minimizeTabGroup

  • minimizeTabGroup(identity?: Identity): Promise<void>
  • Minimizes the tab group for the window context.

    import {tabbing} from 'openfin-layouts';
    
    // Minimizes the tab group for the current window context.
    tabbing.minimizeTabGroup();
    
    // Minimizes the tab group for another windows context.
    tabbing.minimizeTabGroup({uuid: 'App1', name: 'App1'});
    throws

    Promise.reject: If identity is not a valid Identity.

    throws

    Promise.reject: If identity is not an existing tab in a tabstrip.

    Parameters

    • Default value identity: Identity = getId()

      Identity of the window context to minimize the tab group for. If no Identity is provided as an argument the current window context will be used.

    Returns Promise<void>

removeTab

  • removeTab(identity?: Identity): Promise<void>
  • Removes the specified window context from its tab group.

    import {tabbing} from 'openfin-layouts';
    
    // Remove the current context from its tab group.
    tabbing.removeTab();
    
    // Remove another window from its tab group.
    tabbing.removeTab({uuid: 'App1', name: 'App1'});
    throws

    Promise.reject: If identity is not a valid Identity.

    throws

    Promise.reject: If identity is not an existing tab in a tabstrip.

    Parameters

    • Default value identity: Identity = getId()

      Identity of the window context to remove. If no Identity is provided as an argument, the current window context will be used.

    Returns Promise<void>

restoreTabGroup

  • restoreTabGroup(identity?: Identity): Promise<void>
  • Restores the tab group for the window context to its normal state.

    import {tabbing} from 'openfin-layouts';
    
    // Restores the tab group for the current window context.
    tabbing.restoreTabGroup();
    
    // Restores the tab group for another windows context.
    tabbing.restoreTabGroup({uuid: 'App1', name: 'App1'});
    throws

    Promise.reject: If identity is not a valid Identity.

    throws

    Promise.reject: If identity is not an existing tab in a tabstrip.

    Parameters

    • Default value identity: Identity = getId()

      Identity of the window context to restore the tab group for. If no Identity is provided as an argument the current window context will be used.

    Returns Promise<void>

setActiveTab

  • setActiveTab(identity?: Identity): Promise<void>
  • Sets the window context as the active tab in its tab group. Active tabs are brought to the front of the tab group and shown.

    import {tabbing} from 'openfin-layouts'
    
    // Sets the current window as active in the tab group.
    tabbing.setActiveTab()
    
    // Sets another window context as the active tab.
    tabbing.setActiveTab({uuid: 'App1', name: 'App1'});
    throws

    Promise.reject: If identity is not a valid Identity.

    throws

    Promise.reject: If identity is not an existing tab in a tabstrip.

    Parameters

    • Default value identity: Identity = getId()

      Identity of the window context to set as active. If no Identity is provided as an argument the current window context will be used.

    Returns Promise<void>

setTabstrip

  • Creates the custom tabstrip + configuration for the entire application. An application cannot have different windows using different tabstrip UIs.

    import {tabbing} from 'openfin-layouts';
    
    tabbing.setTabstrip({url: 'https://localhost/customTabstrip.html', height: 60});
    throws

    Promise.reject: If config is not a valid ApplicationUIConfig

    throws

    Promise.reject: If config.url is not a valid URL/URI.

    Parameters

    Returns Promise<void>

updateTabProperties

  • updateTabProperties(properties: Partial<TabProperties>, identity?: Identity): Promise<void>
  • Updates a tab's Properties on the Tab strip. This includes the tabs title and icon.

    import {tabbing} from 'openfin-layouts';
    
    // Updating only some properties for the current window context.
    tabbing.updateTabProperties({title: 'An Awesome Tab!'});
    
    // Update all properties for the current window context.
    tabbing.updateTabProperties({title: 'An Awesome Tab!', icon: 'http://openfin.co/favicon.ico'});
    
    // Update properties for another windows context.
    tabbing.updateTabProperties({title: 'An Awesome Tab'}, {uuid: 'App1', name: 'App1'});
    throws

    Promise.reject: If identity is not a valid Identity.

    Parameters

    • properties: Partial<TabProperties>

      Properties object for the tab to consume.

    • Default value identity: Identity = getId()

      Identity of the window context set the properties on. If no Identity is provided as an argument the current window context will be used.

    Returns Promise<void>