Layouts v1 API is deprecated and no longer supported as of OpenFin 16+. Please use Platform API instead.
Event fired when one window is docked to another. See addEventListener.
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';
import {WindowDockedEvent} from 'openfin-layouts/dist/client/snapanddock';
addEventListener('window-docked', async (event: WindowDockedEvent) => {
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());
});
This event is fired when the window first becomes docked. The window will not receive an event if an additional window is added to the group later.
Event fired when one window is undocked from it's neighbor(s). See addEventListener.
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';
import {WindowUndockedEvent} from 'openfin-layouts/dist/client/snapanddock';
addEventListener('window-undocked', async (event: WindowUndockedEvent) => {
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());
});
This event is fired when the current window becomes undocked from a group. A window will not receive this event if another window within the same group is undocked.
Returns an array representing the entities docked with the provided window (see DockGroup for more details).
If the window is not docked returns null.
import {snapAndDock} from 'openfin-layouts';
// Gets all tabs for the current window context.
const myGroup: DockGroup | null = snapAndDock.getDockedWindows();
// Get all tabs for another window context.
const otherWindow: Identity = {uuid: "sample-window-uuid", name: "sample-window-name"}
const otherWindowGroup: DockGroup | null = snapAndDock.getDockedWindows(otherWindow);
The window context, defaults to the current window.
Will undock every window that is currently connected to a current window.
This will completely disband the entire group, not just the windows directly touching identity
.
Has no effect if identity
isn't currently snapped to any other window.
import {snapAndDock} from 'openfin-layouts';
// Undock all windows attached to the current window (all are equivalent)
snapAndDock.undockGroup();
snapAndDock.undockGroup(fin.desktop.Window.getCurrent()); // Using 'v1' API
snapAndDock.undockGroup(fin.Window.getCurrentSync()); // Using 'v2' API
// Undock all windows attached to a different window
snapAndDock.undockGroup({uuid: 'my-app', name: 'other-window'});
A window belonging to the group that should be disbanded, defaults to the current window/group
Undocks a window from any group it currently belongs to.
Has no effect if the window is not currently docked.
import {snapAndDock} from 'openfin-layouts';
// Undock the current window (all are equivalent)
snapAndDock.undockWindow();
snapAndDock.undockWindow(fin.desktop.Window.getCurrent()); // Using 'v1' API
snapAndDock.undockWindow(fin.Window.getCurrentSync()); // Using 'v2' API
// Undock a different window
snapAndDock.undockWindow({uuid: 'my-app', name: 'other-window'});
The window to undock, defaults to the current window
Represents a group of docked entities (windows and/or tab groups)
An array entry of type
WindowIdentity
represents a single windowAn array entry of type
WindowIdentity[]
represents a tab group. The elements of this sub-array are the identities of the tabs that form the tab group.