Editor.Dock.IDockManager
ClassManages the states of Lens Studio panels.
Index
Properties
Methods
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
staticinterfaceId:InterfaceId
Interface identifier for the dock manager.
panels
readonlypanels:IPanelPlugin[]
Array of panels currently in the dock.
Methods
activate()
activate(
panel):void
Activate a panel in the dock.
Parameters
| Parameter | Type |
|---|---|
panel | IPanelPlugin |
Returns
void
activatePanels()
activatePanels(
id):void
Activate panels by group ID.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
add()
add(
panel):void
Add a panel to the dock.
Parameters
| Parameter | Type |
|---|---|
panel | IPanelPlugin |
Returns
void
containsPanels()
containsPanels(
id):boolean
Check if panels with the given group ID exist in the dock.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
boolean
createPanel()
createPanel(
id):void
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
findPanel()
findPanel(
id):IPanelPlugin
Retrieve a panel by ID.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
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
highlight()
highlight(
panel):void
Highlight a panel in the dock.
Parameters
| Parameter | Type |
|---|---|
panel | IPanelPlugin |
Returns
void
highlightPanels()
highlightPanels(
id):void
Highlight panels by group ID.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
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
Inherited from
read()
read(
reader):void
Reads the current state of the DockManager.
Parameters
| Parameter | Type |
|---|---|
reader | IReader |
Returns
void
remove()
remove(
panel):void
Remove a panel from the dock.
Parameters
| Parameter | Type |
|---|---|
panel | IPanelPlugin |
Returns
void
removePanels()
removePanels(
id):void
Remove panels by group ID from the dock.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
write()
write(
writer):void
Writes to the Dock Manager.
Parameters
| Parameter | Type |
|---|---|
writer | IWriter |
Returns
void