LensStudio:Workspaces.Workspace
ClassA 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
Properties
Methods
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
readonlydockManager:IDockManager
Dock manager that holds this workspace's panels and layout.
metadata
readonlymetadata:Metadata
Display name and icon of this workspace.
Methods
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean