Skip to main content

LensStudio:Workspaces.Workspace

Class

A workspace open in Lens Studio: a named tab with its own panel layout.

A workspace open in Lens Studio: a named tab with its own panel layout. Get open workspaces from IWorkspaceManager.all or the manager's signals.

Index

Example

Find every open instance of a panel across all workspaces. Each workspace has its own dock manager, so a panel open in another tab is not in the current workspace's layout.

import { IWorkspaceManager } from 'LensStudio:Workspaces';

export interface PanelLocation {
workspace: string;
panel: IPanelPlugin;
}

export function findPanelInWorkspaces(pluginSystem: Editor.PluginSystem, panelId: string): PanelLocation[] {
const manager = pluginSystem.findInterface(IWorkspaceManager) as IWorkspaceManager;
if (Editor.isNull(manager)) throw new Error('The workspace manager is unavailable');
return manager.all.flatMap(workspace =>
workspace.dockManager.panels
.filter(panel => !Editor.isNull(panel) && panel.id === panelId)
.map(panel => ({ workspace: workspace.metadata.name, panel })));
}

The panels belong to Lens Studio; read them while they are open and do not delete them.

Extends

Properties

dockManager

readonly dockManager: IDockManager

Dock manager that holds this workspace's panels and layout.


metadata

readonly metadata: Metadata

Display name and icon of this workspace.

Methods

getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame