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.
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.
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.
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.
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);
});
Registers a listener for any events raised by the service.
Allows a window to opt-out of this service.
This will disable all layouts-related functionality for the given window.
The window to deregister, defaults to the current window
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.
join-snap-group