Preparing search index...

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

    // ProjectSettingsPlugin (the same class exported at the module root) is the
    // base class to extend for a custom Project Settings panel. The descriptor
    // names the panel and assigns it a section + icon; createWidget builds the
    // panel body; deinit() releases any retained widgets/connections.
    import { ProjectSettingsPlugin, Descriptor } from 'LensStudio:ProjectSettingsPlugin';
    import * as Ui from 'LensStudio:Ui';

    export class ProjectSettingsPluginOverviewExampleSettings extends ProjectSettingsPlugin {
    connections: any[];
    root: Ui.Widget | null;
    static descriptor(): Descriptor {
    const d = new Descriptor();
    d.id = 'com.docs.ProjectSettingsPluginOverviewExample';
    d.name = 'Settings Class Example';
    d.description = 'Demonstrates ProjectSettingsPlugin class lifecycle';
    d.title = 'Class Example';
    d.section = 'General Settings';
    d.icon = Editor.Icon.fromFile(new Editor.Path(import.meta.resolve('icon.svg')));
    d.dependencies = [Ui.IGui, Editor.Model.IModel];
    return d;
    }
    constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
    super(pluginSystem, descriptor);
    this.connections = [];
    this.root = null;
    }
    createWidget(parent: Ui.Widget): Ui.Widget {
    this.root = new Ui.Widget(parent);
    const layout = new Ui.BoxLayout();
    layout.setDirection(Ui.Direction.TopToBottom);

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

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

    this.root.layout = layout;
    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

    Unique string identifier of the plugin instance.

    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