Beta
A registry of Editor.ContextAction which will be shown in a contextual menu (i.e. right click).
import { CoreService } from 'LensStudio:CoreService';export class ContextActionRegistry extends CoreService { static descriptor() { return { id: 'com.example.contextActionRegistry', name: 'ContextActionRegistry', description: 'ContextActionRegistry', interfaces: CoreService.descriptor().interfaces, dependencies: [Editor.IContextActionRegistry] }; } constructor(pluginSystem) { super(pluginSystem); this.guards = []; } start() { const contextActionRegistry = this.pluginSystem.findInterface(Editor.IContextActionRegistry); this.guards.push(contextActionRegistry.registerAction((context) => { const action = new Editor.ContextAction(); action.id = 'Test Action Id'; action.caption = 'Test Action Caption'; action.description = 'Test Action Description'; action.group = ['Test Group']; action.apply = () => { }; return action; })); } stop() { this.guards = []; }} Copy
import { CoreService } from 'LensStudio:CoreService';export class ContextActionRegistry extends CoreService { static descriptor() { return { id: 'com.example.contextActionRegistry', name: 'ContextActionRegistry', description: 'ContextActionRegistry', interfaces: CoreService.descriptor().interfaces, dependencies: [Editor.IContextActionRegistry] }; } constructor(pluginSystem) { super(pluginSystem); this.guards = []; } start() { const contextActionRegistry = this.pluginSystem.findInterface(Editor.IContextActionRegistry); this.guards.push(contextActionRegistry.registerAction((context) => { const action = new Editor.ContextAction(); action.id = 'Test Action Id'; action.caption = 'Test Action Caption'; action.description = 'Test Action Description'; action.group = ['Test Group']; action.apply = () => { }; return action; })); } stop() { this.guards = []; }}
Adds the action to the registry.
action
A registry of Editor.ContextAction which will be shown in a contextual menu (i.e. right click).
Example