Skip to main content

LensStudio:DialogPlugin.Descriptor

Class

Configuration descriptor for a DialogPlugin, including menu placement and optional toolbar settings.

Index

Example

// DialogPlugin Descriptor extends BaseDescriptor with dialog-specific fields:
//
// menuActionHierarchy: string[]
// Menu path where the dialog action appears.
// Example: ['Tools', 'Utilities', 'My Dialog']
//
// toolbarConfig (optional):
// Configuration for a toolbar button that also opens the dialog.

export class DialogPluginDescriptorExampleDialog extends DialogPlugin {
connections: any[];
static descriptor() {
const d = new Descriptor();
d.id = 'com.docs.DialogPluginDescriptorExample';
d.name = 'Dialog Descriptor Example';
d.description = 'Shows DialogPlugin Descriptor with menuActionHierarchy';
// menuActionHierarchy controls where the action appears in the menu bar
d.menuActionHierarchy = ['Tools', 'Utilities', 'Descriptor Example'];
return d;
}
constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
super(pluginSystem, descriptor);
this.connections = [];
}
show(parent: Widget): Dialog {
const dialog = new Dialog(parent);
const layout = new BoxLayout();
layout.setDirection(Direction.TopToBottom);
dialog.layout = layout;

const label = new Label(dialog);
label.text = 'Opened from: Tools > Utilities > Descriptor Example';
layout.addWidget(label);

const btn = new PushButton(dialog);
btn.text = 'OK';
this.connections.push(btn.onClick.connect(() => dialog.accept()));
layout.addWidget(btn);

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

Extends

Constructors

Constructor

new Descriptor(): Descriptor

Creates a new DialogPlugin Descriptor instance for configuring dialog plugin metadata.

Returns

Descriptor

Overrides

BaseDescriptor.constructor

Properties

dependencies

dependencies: InterfaceId[]

Array of interface IDs that this plugin requires to function.

Inherited from

BaseDescriptor.dependencies


description

description: string

Human-readable description of the plugin shown in the plugin manager.

Inherited from

BaseDescriptor.description


id

id: string

Unique identifier for the plugin, typically in reverse domain notation.

Inherited from

BaseDescriptor.id


intendedPlatforms

intendedPlatforms: TargetPlatform[]

Array of target platforms (Snapchat, Spectacles) where this plugin is intended to run.

Inherited from

BaseDescriptor.intendedPlatforms


interfaces

interfaces: InterfaceId[]

Array of interface IDs that this plugin provides or implements.

Inherited from

BaseDescriptor.interfaces


menuActionHierarchy: string[]

Menu path hierarchy defining where the dialog's action appears in the editor menu.


name

name: string

Display name of the plugin.

Inherited from

BaseDescriptor.name


toolbarConfig?

optional toolbarConfig?: ToolbarConfig

Configuration object specifying how the dialog's action is represented in the editor toolbar.

Methods

getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

BaseDescriptor.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

BaseDescriptor.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

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

BaseDescriptor.isSame