Preparing search index...

    Base class for plugins that create persistent UI panels; extend this and implement createWidget() to build panel UI.

        // PanelPlugin lifecycle:
    // 1. createWidget(parent) — framework calls this to build the UI
    // 2. User interacts with the panel
    // 3. deinit() — framework calls this on shutdown
    const root = new Widget(parent);
    const layout = new BoxLayout();
    layout.setDirection(Direction.TopToBottom);
    layout.spacing = 8;
    root.layout = layout;

    const title = new Label(root);
    title.text = 'PanelPlugin Lifecycle';
    title.fontRole = FontRole.TitleBold;
    layout.addWidget(title);

    const status = new Label(root);
    status.text = 'createWidget() was called by the framework.';
    layout.addWidget(status);

    const toggle = new CheckBox(root);
    toggle.text = 'Enable feature';
    toggle.checked = false;
    layout.addWidget(toggle);

    this.connections.push(
    toggle.onToggle.connect((on: boolean) => {
    status.text = `Feature: ${on ? 'enabled' : 'disabled'}`;
    })
    );

    const btn = new PushButton(root);
    btn.text = 'Access pluginSystem';
    layout.addWidget(btn);

    this.connections.push(
    btn.onClick.connect(() => {
    const descriptors = this.pluginSystem.descriptors;
    status.text = `pluginSystem has ${descriptors.length} registered plugins.`;
    })
    );

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    id: string
    pluginSystem: PluginSystem

    The plugin system instance used to resolve interface dependencies.

    title: string

    Read-only string displayed as the panel's title.

    widget: Widget

    Read-only UI widget rendered inside the panel.

    Methods

    • Creates and returns the root widget for the panel, parented to the given widget.

      Parameters

      Returns Widget

    • Tears down the plugin and releases any resources it holds.

      Returns void

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

      Parameters

      • type: string

      Returns boolean