如何将菜单项添加到“运行方式”? [英] How to add menu entry to "Run As"?

查看:104
本文介绍了如何将菜单项添加到“运行方式”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse的插件开发环境中,如何为特定编辑器添加菜单项运行方式?

In Plugin Developpment Environnement of Eclipse, How ca i add an menu entry to "Run As" for a specific Editor?

推荐答案

p>您可以在Eclipse文章中获得一些提示:

You can get some tips in the Eclipse article:

我们有电梯:Eclipse中的启动框架


声明启动配置类型

创建我们的小程序启动器的第一步是声明配置类型,如下所示我们的插件的plugin.xml文件中的XML片段:

非UI声明

The first step in creating our applet launcher is declaring a config type, as shown in the following snippet of XML from our plug-in's plugin.xml file:
Non-UI declaration



<extension point="org.eclipse.debug.core.launchConfigurationTypes">
    <launchConfigurationType
        name="Java Applet"
        delegate="org.eclipse.jdt.internal.launching.JavaAppletLaunchConfigurationDelegate"
        modes="run, debug"               
        id="org.eclipse.jdt.launching.javaApplet">        
    </launchConfigurationType>
</extension>




此声明中最重要的部分是委托属性,实现接口的类的完全限定名称 org.eclipse.debug.core.model.ILaunchConfigurationDelegate

代表是启动器的大脑,并实现启动指定配置的 launch()方法。

这篇关于如何将菜单项添加到“运行方式”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆