Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在插件的处理程序中调用命令id_Java_Eclipse_Plugin.xml - Fatal编程技术网

Java 在插件的处理程序中调用命令id

Java 在插件的处理程序中调用命令id,java,eclipse,plugin.xml,Java,Eclipse,Plugin.xml,我有一个触发Run的菜单(Ctrl+F11) 但我想做更多的行动,而不是跑 我想在处理程序中调用run的命令id public class CheckCodesHandler extends AbstractHandler{ @Override public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.

我有一个触发Run的菜单(
Ctrl+F11

但我想做更多的行动,而不是跑

我想在处理程序中调用run的命令id

public class CheckCodesHandler extends AbstractHandler{

    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {
        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

        /*
         * call the commandid = org.eclipse.debug.ui.runLast here?????
         * */
        return null;
    }
}

到目前为止,我只是调用plugin.xml中的命令id来执行它。

对于一个不需要参数的简单命令,您可以使用它

IHandlerService service = window.getService(IHandlerService.class);

service.executeCommand("command id", null);