LensStudio:DialogPlugin.Descriptor
ClassConfiguration descriptor for a DialogPlugin, including menu placement and optional toolbar settings.
Index
Properties
Methods
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
description
description:
string
Human-readable description of the plugin shown in the plugin manager.
Inherited from
id
id:
string
Unique identifier for the plugin, typically in reverse domain notation.
Inherited from
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
menuActionHierarchy
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
toolbarConfig?
optionaltoolbarConfig?:ToolbarConfig
Configuration object specifying how the dialog's action is represented in the editor toolbar.
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