Manages the states of Lens Studio panels.

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() {
}
}
interface IDockManager {
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    read(reader: IReader): void;
    write(writer: IWriter): void;
}

Hierarchy (view full)

Methods

  • Beta

    Reads the current state of the DockManager.

    Parameters

    Returns void

  • Beta

    Writes to the Dock Manager.

    Parameters

    Returns void