3

我正在为 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。另外,我已经将自己的记录器添加到构造函数和方法中,但是该类似乎甚至从未实例化。

4

2 回答 2

4

我不得不contextualLaunchorg.eclipse.debug.ui.launchShortcuts.

旧的方式似乎很久以前就被弃用了。

对于从事同一主题工作的其他人,您可能也希望扩展org.eclipse.ui.commands和绑定。

我无法选择这个答案,但这是我(提问者)正在寻找的答案。

于 2008-09-02T18:27:40.167 回答
0

你的班级应该实现 ILaunchShortcut。查看Javadoc

你得到什么例外?检查错误日志。

于 2008-08-25T16:23:42.430 回答