题
我正在为 Eclipse 3.2 (JBuilder 2007-8) 制作一个简单的额外 java 应用程序启动器以供内部使用。
所以我查了所有相关的文档,包括这个 来自 eclipse.org 的启动框架 并设法使除启动快捷方式之外的其他所有内容正常工作。
这是我的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。另外,我已将自己的记录器添加到构造函数和方法中,但该类似乎从未实例化。
解决方案
我必须添加 contextualLaunch
在下面 org.eclipse.debug.ui.launchShortcuts
.
旧的方式似乎很久以前就被弃用了。
对于其他从事同一主题的人,您可能想扩展 org.eclipse.ui.commands
还有绑定。
我无法选择这个答案,但这是我(提问者)正在寻找的答案。
其他提示
您的类应该实现 ILaunchShortcut。查看 Java文档.
你遇到什么异常?检查错误日志。
不隶属于 StackOverflow