Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute command/handler of an existing plugin from a different plugin

I have an RCP application with an existing command and handler to switch perspective programmatically. And I also have and new plugin consumed by the existing RCP application. I want this new plugin to execute the command/handler of my RCP application, what can be the possible solution for this?

like image 983
Louie Avatar asked Nov 27 '25 10:11

Louie


1 Answers

You may need to define a handler for that command (not sure), but executing commands programmatically looks like this:

Command command = ((ICommandService) getSite().getService(ICommandService.class)).getCommand(commandId);
...
final Event trigger = new Event();
ExecutionEvent executionEvent = ((IHandlerService) getSite().getService(IHandlerService.class)).createExecutionEvent(command, trigger);
command.executeWithChecks(executionEvent);
like image 155
Bela Vizer Avatar answered Nov 28 '25 23:11

Bela Vizer