Skip to main content

Editor.Dock.IDockManager

Class

Manages the states of Lens Studio panels.

Index

Example

import CoreService from 'LensStudio:CoreService';
import * as serialization from 'LensStudio:Serialization';

export class DockManager extends CoreService {
static descriptor() {
return {
id: 'Snap.Test.DockManager',
name: 'DockManager',
description: 'DockManager',
interfaces: CoreService.descriptor().interfaces,
dependencies: [Editor.Dock.IDockManager]
};
}

constructor(pluginSystem) {
super(pluginSystem);
this.guards = [];
}

start() {
const layoutStr = 'dock:\n' +
d: false\n' +
' main:\n' +
' items:\n' +
' - items:\n';

// Simply test that reader and writer can be created and used without throwing
let reader = serialization.Yaml.createReader(layoutStr);
const writer = serialization.Yaml.createWriter();

const dockManager = this.pluginSystem.findInterface(Editor.Dock.IDockManager);
dockManager.write(writer);
const writtenContent = writer.getString();
reader = serialization.Yaml.createReader(writtenContent);
}

stop() {
}
}

Extends

Properties

interfaceId

static interfaceId: InterfaceId

Interface identifier for the dock manager.


panels

readonly panels: IPanelPlugin[]

Array of panels currently in the dock.

Methods

activate()

activate(panel): void

Activate a panel in the dock.

Parameters

ParameterType
panelIPanelPlugin

Returns

void


activatePanels()

activatePanels(id): void

Activate panels by group ID.

Parameters

ParameterType
idstring

Returns

void


add()

add(panel): void

Add a panel to the dock.

Parameters

ParameterType
panelIPanelPlugin

Returns

void


containsPanels()

containsPanels(id): boolean

Check if panels with the given group ID exist in the dock.

Parameters

ParameterType
idstring

Returns

boolean


createPanel()

createPanel(id): void

Parameters

ParameterType
idstring

Returns

void


findPanel()

findPanel(id): IPanelPlugin

Retrieve a panel by ID.

Parameters

ParameterType
idstring

Returns

IPanelPlugin


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

IPluginComponent.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

IPluginComponent.getTypeName


highlight()

highlight(panel): void

Highlight a panel in the dock.

Parameters

ParameterType
panelIPanelPlugin

Returns

void


highlightPanels()

highlightPanels(id): void

Highlight panels by group ID.

Parameters

ParameterType
idstring

Returns

void


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

IPluginComponent.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

IPluginComponent.isSame


read()

read(reader): void

Reads the current state of the DockManager.

Parameters

ParameterType
readerIReader

Returns

void


remove()

remove(panel): void

Remove a panel from the dock.

Parameters

ParameterType
panelIPanelPlugin

Returns

void


removePanels()

removePanels(id): void

Remove panels by group ID from the dock.

Parameters

ParameterType
idstring

Returns

void


write()

write(writer): void

Writes to the Dock Manager.

Parameters

ParameterType
writerIWriter

Returns

void