Options
All
  • Public
  • Public/Protected
  • All
Menu

External module Home

Index

Events

JoinSnapGroupEvent

JoinSnapGroupEvent: Event & object

Event fired when one window is docked to another.

It is not possible to receive events for another window. When adding a listener, the listener will only ever fire for the "fin.desktop.Window.getCurrent()" window.

import {addEventListener} from 'openfin-layouts';

addEventListener('join-snap-group', async (event: Event) => {
    console.log("Docked to another window");

    // Using 'v1' API
    fin.desktop.Window.getCurrent().getGroup((windows) => {
        console.log("Windows in current group: ", windows);
    });

    // Using 'v2' API
    console.log("Windows in current group: ", await fin.Window.getCurrentSync().getGroup());
});

The service considers any windows that are tabbed together to also be in the same snap group, so this event will also fire when a window is added to a tab group. This may change in future versions of the service.

type

join-snap-group

JoinTabGroupEvent

JoinTabGroupEvent: CustomEvent<JoinTabGroupPayload> & object

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 {addEventListener, getTabs} from 'openfin-layouts';

addEventListener('join-tab-group', async (event: CustomEvent<JoinTabGroupPayload>) => {
    console.log("Window added to tab group");
    console.log("Windows in current group: ", await getTabs());
});

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

type

join-tab-group

LeaveSnapGroupEvent

LeaveSnapGroupEvent: Event & object

Event fired when one window is undocked from it's neighbor(s).

It is not possible to receive events for another window. When adding a listener, the listener will only ever fire for the "fin.desktop.Window.getCurrent()" window.

import {addEventListener} from 'openfin-layouts';

addEventListener('leave-snap-group', async (event: Event) => {
    console.log("Undocked from another window");

    // Using 'v1' API
    fin.desktop.Window.getCurrent().getGroup((windows) => {
        console.log("Windows in current group: ", windows);
    });

    // Using 'v2' API
    console.log("Windows in current group: ", await fin.Window.getCurrentSync().getGroup());
});

The service considers any windows that are tabbed together to also be in the same snap group, so this event will also fire when a window is removed from a tab group. This may change in future versions of the service.

type

leave-snap-group

LeaveTabGroupEvent

LeaveTabGroupEvent: CustomEvent<TabGroupEventPayload> & object

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 {addEventListener} from 'openfin-layouts';

addEventListener('leave-tab-group', async (event: Event) => {
    console.log("Window removed from tab group");
});

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

type

leave-tab-group

TabActivatedEvent

TabActivatedEvent: CustomEvent<TabGroupEventPayload> & object

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

import {addEventListener, getTabs} from 'openfin-layouts';

addEventListener('tab-activated', async (event: Event) => {
    const activeTab = event.detail.tabID;
    console.log("Active tab:", activeTab.uuid, activeTab.name);
});

NOTE: This event is only passed to tabstrip windows, and not to the actual application windows within the tabset.

type

tab-activated

TabPropertiesUpdatedEvent

TabPropertiesUpdatedEvent: CustomEvent<TabPropertiesUpdatedPayload> & object

Event fired whenever a tabs properties are updated (via updateTabProperties).

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

import {addEventListener, getTabs} from 'openfin-layouts';

addEventListener('tab-properties-updated', async (event: CustomEvent<TabPropertiesUpdatedPayload>) => {
    const tabID = event.detail.tabID;
    const properties = event.detail.properties;
    console.log(`Properties for ${tabID.uuid}/${tabID.name} are:`, properties);
});
type

tab-properties-updated

Functions

addEventListener

  • addEventListener<K>(type: K, listener: function): Promise<void>
  • Registers a listener for any events raised by the service.

    Type parameters

    • K: keyof EventMap

    Parameters

    • type: K
    • listener: function
        • (event: EventMap[K]): void
        • Parameters

          • event: EventMap[K]

          Returns void

    Returns Promise<void>

deregister

  • deregister(identity?: Identity): Promise<void>
  • Allows a window to opt-out of this service.

    This will disable all layouts-related functionality for the given window.

    Parameters

    • Default value identity: Identity = getId()

      The window to deregister, defaults to the current window

    Returns Promise<void>