gpt4 book ai didi

eclipse - 从不同的插件执行现有插件的命令/处理程序

转载 作者:行者123 更新时间:2023-12-01 10:06:40 25 4
gpt4 key购买 nike

我有一个带有现有命令和处理程序的 RCP 应用程序,可以以编程方式切换透视图。我还有现有 RCP 应用程序使用的新插件。我想要这个新插件来执行我的 RCP 应用程序的命令/处理程序,可能的解决方案是什么?

最佳答案

您可能需要为该命令定义一个处理程序(不确定),但以编程方式执行命令看起来像这样:

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);

关于eclipse - 从不同的插件执行现有插件的命令/处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9666818/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com