无法添加启动快捷方式(Eclipse插件)
时间:2020-03-05 18:42:51 来源:igfitidea点击:
我正在为Eclipse 3.2(JBuilder 2007-8)制作一个简单的额外Java应用启动器,以供内部使用。
因此,我查阅了所有相关文档,包括eclipse.org上的The Launching Framework,并设法使所有其他功能(启动快捷方式除外)都能正常工作。
这是我的plugin.xml的一部分。
<extension point="org.eclipse.debug.ui.launchShortcuts"> <shortcut category="mycompany.javalaunchext.launchConfig" class="mycompany.javalaunchext.LaunchShortcut" description="launchshortcutsdescription" icon="icons/k2mountain.png" id="mycompany.javalaunchext.launchShortcut" label="Java Application Ext." modes="run, debug"> <perspective id="org.eclipse.jdt.ui.JavaPerspective"> </perspective> <perspective id="org.eclipse.jdt.ui.JavaHierarchyPerspective"> </perspective> <perspective id="org.eclipse.jdt.ui.JavaBrowsingPerspective"> </perspective> <perspective id="org.eclipse.debug.ui.DebugPerspective"> </perspective> </shortcut>
我相信类别部分中的配置名称正确,并且类别部分中的类正确实现。 (基本上从org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut复制)
我真的不确定我是否应该在这里写一份后续报告,但让我进一步澄清我的问题。
我已经扩展了org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut。
另外,我已经将自己的记录器添加到构造函数和方法中,但是该类似乎从未实例化。
解决方案
回答
课程应该实现ILaunchShortcut。
签出Javadoc。
你有什么例外?检查错误日志。
回答
我必须在" org.eclipse.debug.ui.launchShortcuts"下添加" contextualLaunch"。
旧的方法似乎早已过时了。
对于从事同一主题的其他人,
我们可能还想扩展org.eclipse.ui.commands和绑定。
我无法选择此答案,但这是我(提问者)想要的答案。