Preparing search index...

    Constructs a project settings plugin bound to the given plugin system and optional descriptor.

    // ProjectSettingsPlugin is the class you extend to add a custom settings panel
    // to the Lens Studio Project Settings dialog.
    //
    // Members:
    // createWidget(parent: Widget): Widget — build your settings UI
    // deinit(): void — release resources
    // setIssues(issues): void — report Error/Warning/NoIssue
    // pluginSystem (readonly) — resolve interface dependencies

    export class ProjectSettingsPluginOverviewExampleSettings extends ProjectSettingsPlugin {
    connections: any[];
    root: Widget | null;
    static descriptor() {
    const d = new Descriptor();
    d.id = 'com.docs.ProjectSettingsPluginOverviewExample';
    d.name = 'Settings Class Example';
    d.description = 'Demonstrates ProjectSettingsPlugin class lifecycle';
    d.section = 'Examples';
    d.dependencies = [Editor.Model.IModel];
    return d;
    }
    constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
    super(pluginSystem, descriptor);
    this.connections = [];
    this.root = null;
    }
    createWidget(parent: Widget): Widget {
    this.root = new Widget(parent);
    const layout = new BoxLayout();
    layout.setDirection(Direction.TopToBottom);
    layout.spacing = 8;
    this.root.layout = layout;

    const model = this.pluginSystem.findInterface(Editor.Model.IModel) as unknown as Editor.Model.IModel;
    const assetCount = model.project.assetManager.assets.length;

    const info = new Label(this.root);
    info.text = `Project has ${assetCount} asset(s)`;
    info.wordWrap = true;
    layout.addWidget(info);

    return this.root;
    }
    deinit(): void {
    this.connections.forEach((c: any) => c?.disconnect());
    this.connections = [];
    if (this.root) { this.root.deleteLater(); this.root = null; }
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    id: string
    pluginSystem: PluginSystem

    Reference to the plugin system instance.

    Methods

    • Creates and returns a UI widget for the project settings panel. The returned widget must be a child of the provided parent widget. Called by the project settings dialog to render the plugin's UI.

      Parameters

      Returns Widget

    • Call to shut down or unloadplugin. Used to clean up resources, listeners, or state.

      Returns void

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object refers to the same instance as the given object.

      Parameters

      Returns boolean

    • Sets the current issue status (errors, warnings, or no issues) for this settings panel. Triggers the issuesChanged signal when statuses change, allowing the settings dialog to update visual indicators.

      Parameters

      Returns void