Layouts v1 API is deprecated and no longer supported as of OpenFin 16+. Please use Platform API instead.
Identifies the window that is the source of the current event.
Identity object that uniquely identifies the current tabset.
Event fired whenever the current window is tabbed. This event is used when adding windows to both new and existing tabsets. See addEventListener.
To find out which other windows are in the tabset, use the getTabs()
method.
import {tabbing} from 'openfin-layouts';
import {TabAddedEvent} from 'openfin-layouts/dist/client/tabbing';
tabbing.addEventListener('tab-added', async (event: TabAddedEvent) => {
console.log("Window added to tab group: ", event.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
.
Identifies the window that is the source of the current event.
The index at which the tab was inserted.
An integer in the range [0, <tab count>-1]
.
The properties of the newly-added tab.
These will be generated from the identity
window, or will be whatever properties were previously set for the identity
window using
updateTabProperties.
Identity object that uniquely identifies the current tabset.
Event fired whenever a windows tab properties are updated. See addEventListener.
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';
import {TabPropertiesUpdatedEvent} from 'openfin-layouts/dist/client/tabbing';
tabbing.addEventListener('tab-properties-updated', (event: TabPropertiesUpdatedEvent) => {
const tabIdentity = event.identity;
const properties = event.properties;
console.log(`Properties for ${tabIdentity.uuid}/${tabIdentity.name} are:`, properties);
});
Identifies the window that is the source of the current event.
New tab properties.
This will always contain the full set of properties for the tab, even if only a subset of the properties were updated in the updateTabProperties call.
Event fired whenever the current window is removed from it's previous tabset. See addEventListener.
To find out which other windows are in the tabset, use the getTabs()
method.
import {tabbing} from 'openfin-layouts';
import {TabRemovedEvent} from 'openfin-layouts/dist/client/tabbing';
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
.
Identifies the window that is the source of the current event.
Identity object that uniquely identifies the current tabset.
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'});
Note that the identity
doesn't need to be tabbed for this call to take effect - so long as the window is known with the service.
Identity of the window context to close. If no Identity
is provided as an argument the current window context will be used.
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'});
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.
Creates a tabgroup with the provided windows. The first window in the set will be used to define the tab strips properties. See setTabstrip.
import {tabbing} from 'openfin-layouts';
tabbing.createTabGroup([{uuid: "App1", name: "App1"}, {uuid: "App2", name: "App2"}, {uuid: "App3", name: "App3"}]);
Array of window Identities which will be added to the new tab group.
The Identity of the window to set as the active tab in the group. If not provided, the first tab in the tab group will be set as the active tab.
Returns array of window identity references for tabs belonging to the tab group of the provided window context.
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"});
The window context, defaults to the current window.
Maximizes the tab group for the window context.
import {tabbing} from 'openfin-layouts';
// Maximizes the tab group for the current window context.
tabbing.maxmimizeTabGroup();
// Maximizes the tab group for another windows context.
tabbing.maximizeTabGroup({uuid: 'App1', name: 'App1'});
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.
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'});
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.
Removes the specified window context from its tab group. This does not close the window.
import {tabbing} from 'openfin-layouts';
// Remove the window from its tab group.
tabbing.removeTab();
// Remove another window from its tab group.
tabbing.removeTab({uuid: 'App1', name: 'App1'});
Identity of the window context to remove. If no Identity
is provided as an argument, the current window context will be used.
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'});
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.
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'});
Identity of the window context to set as active. If no Identity
is provided as an argument the current window context will be used.
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});
The Application UI Configuration object.
Adds the current window context as a tab to the provided window context.
The added tab will be brought into focus.
import {tabbing} from 'openfin-layouts';
// Tab current window to App1.
tabbing.tabSelfTo({uuid: 'App1', name: 'App1'});
Adds the provided window context as a tab to the current window context.
The added tab will be brought into focus.
import {tabbing} from 'openfin-layouts';
// Tab App2 to current window.
tabbing.tabToSelf({uuid: 'App2', name: 'App2'});
Tabs two windows together. If the targetWindow is already in a group, the tab will be added to that group.
The added tab will be brought into focus.
import {tabbing} from 'openfin-layouts';
// Tab App1 to App2
tabbing.tabWindowToWindow({uuid: 'App1', name: 'App1'}, {uuid: 'App2', name: 'App2'});
The identity of the window to add to the tab group.
The identity of the window to create a tab group on.
Updates a tab's properties. Properties for a tab include its title and icon when in a tab group.
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'});
Properties object for the tab to consume.
Identity of the window context set the properties on. If no Identity
is provided as an argument the current window context will be used.
Event fired whenever the active tab within a tab group is changed. See addEventListener.
import {tabbing} from 'openfin-layouts'; import {TabActivatedEvent} from 'openfin-layouts/dist/client/tabbing'; tabbing.addEventListener('tab-activated', (event: TabActivatedEvent) => { const activeTab = event.identity; console.log("Active tab:", activeTab.uuid, activeTab.name); });