LensStudio:Ui.EditorsManager
ClassManages text and code editors.
Index
Properties
Methods
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
staticinterfaceId:InterfaceId
Interface identifier for retrieving this plugin component.
Inherited from
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
Inherited from
openEditors()
openEditors(
entity,editorPluginIds?):void
Open editors for the specified entity with optional plugin-specific configurations.
Parameters
| Parameter | Type |
|---|---|
entity | Entity |
editorPluginIds? | any |
Returns
void