无法添加启动快捷方式(Eclipse插件)

时间:2023-01-15 12:54:55

I'm making a simple extra java app launcher for Eclipse 3.2 (JBuilder 2007-8) for internal use.

我正在为Eclipse 3.2(JBuilder 2007-8)制作一个简单的额外Java应用程序启动器供内部使用。

So I looked up all the documentations related, including this one The Launching Framework from eclipse.org and have managed to make everything else working with the exception of the launch shortcut.

所以我查阅了所有相关的文档,包括eclipse.org中的一个The Launching Framework,除了启动快捷方式之外,还设法使其他所有工作都工作。

无法添加启动快捷方式(Eclipse插件)

This is the part of my plugin.xml.

这是我的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>

The configuration name in the category section is correct and the class in the class section, i believe, is correctly implemented. (basically copied from org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut)

类别部分中的配置名称是正确的,我认为类部分中的类是正确实现的。 (基本上是从org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut复制的)


I'm really not sure if I'm supposed to write a follow-up here but let me clarify my question more. I've extended org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut. Plus, I've added my own logger to constructors and methods, but the class seems like it's never even instantiating.

我真的不确定我是否应该在这里写下一个跟进,但让我更多地澄清我的问题。我已经扩展了org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut。另外,我已经将自己的记录器添加到构造函数和方法中,但是类似乎从未实例化过。

2 个解决方案

#1


4  

I had to add contextualLaunch under org.eclipse.debug.ui.launchShortcuts.

我不得不在org.eclipse.debug.ui.launchShortcuts下添加contextualLaunch。

The old way seems like it's deprecated a long ago.

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

For other people who are working on the same subject, you might want to extend org.eclipse.ui.commands and bindings, too.

对于正在处理同一主题的其他人,您可能也想扩展org.eclipse.ui.commands和bindings。

I cannot choose this answer but this is the answer that I (the questioner) was looking for.

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

#2


0  

You class should implement ILaunchShortcut. Check out the Javadoc.

您的类应该实现ILaunchShortcut。看看Javadoc。

What exception are you getting? Check the error log.

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

#1


4  

I had to add contextualLaunch under org.eclipse.debug.ui.launchShortcuts.

我不得不在org.eclipse.debug.ui.launchShortcuts下添加contextualLaunch。

The old way seems like it's deprecated a long ago.

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

For other people who are working on the same subject, you might want to extend org.eclipse.ui.commands and bindings, too.

对于正在处理同一主题的其他人,您可能也想扩展org.eclipse.ui.commands和bindings。

I cannot choose this answer but this is the answer that I (the questioner) was looking for.

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

#2


0  

You class should implement ILaunchShortcut. Check out the Javadoc.

您的类应该实现ILaunchShortcut。看看Javadoc。

What exception are you getting? Check the error log.

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