Skip to main content

LensStudio:Ui.EditorsManager

Class

Manages text and code editors.

Index

Example

// EditorsManager is the concrete implementation of IEditorsManager.
// Use openEditors(entity) to open the editor for a scene entity.
const em = this.pluginSystem.findInterface(IEditorsManager.interfaceId) as IEditorsManager;
if (Editor.isNull(em)) {
console.log('IEditorsManager not available');
return;
}

const model = this.pluginSystem.findInterface(
Editor.Model.IModel.interfaceId
) as Editor.Model.IModel;
if (Editor.isNull(model)) {
console.log('IModel not available');
return;
}

const scene = model.project.scene;
const roots = scene.rootSceneObjects;
if (roots.length > 0) {
em.openEditors(roots[0]);
console.log('Opened editors for:', roots[0].name);
}

Extends

Properties

interfaceId

static interfaceId: InterfaceId

Interface identifier for retrieving this plugin component.

Inherited from

IEditorsManager.interfaceId

Methods

getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

IEditorsManager.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

IEditorsManager.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

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

IEditorsManager.isSame


openEditors()

openEditors(entity, editorPluginIds?): void

Open editors for the specified entity with optional plugin-specific configurations.

Parameters

ParameterType
entityEntity
editorPluginIds?any

Returns

void

Inherited from

IEditorsManager.openEditors