Skip to content
Discussion options

You must be logged in to vote

Hi @madamedefarge,

Yes, this is possible. You can inject the CommandRegistry into your UIExtension and then setup an event-Listener for an UI-Event e.g. onClick that then calls this.commandRegistry.executeCommand('my-command-id);

Here is a quick overview of the implementation steps for customzing e.g. the ToolPalette:

  • Create a subclass that extends the ToolPalette class ( let's call it MyToolPalette)

  • Inject the Theia ComandRegistry into this class:

    @injectable()
    export class MyToolPalette extends ToolPalette {
        @inject(CommandRegistry)
        protected readonly commandRegistry: CommandRegistry;
    
      //...
    }
  • Create the new UI element that you want to use for sending the commands (e.g. …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@madamedefarge
Comment options

Answer selected by martin-fleck-at
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants