Eclipse插件:将启动命令组添加到自定义透视图 [英] Eclipse plug-in: add Launch command group to Custom Perspective
问题描述
我已经在线查找了很多教程,很难找到与Launches相关的任何内容。
I have looked for a lot of tutorials online and it is very difficult to find anything related to Launches.
我正在实现一个IDE插件,它实现了自定义透视图,除了运行最后一个工具按钮,我看不到任何运行或调试工具栏按钮。每次我启动视角,我需要进入自定义透视图,然后进入命令组可见性并激活启动命令组。
I am implementing an IDE plug-in which implements a custom perspective and I cannot see any of the Run or Debug toolbar buttons except the Run Last Tool button. Everytime I launch the perspective, I need to go into Customize Perspective and then Command Group Visibility and activate the Launch command group.
我已经实现了一个LaunchConfigurationType,基本上是试图添加LaunchShortcuts。
I have implemented a LaunchConfigurationType and am basically trying to add LaunchShortcuts.
我在某处找到您需要创建一个 ILaunchable
适配器,使运行方式为...并调试为...可见。这是我在plugin.xml中添加的,
I read somewhere that you need to create an ILaunchable
adapter to make the Run as... and Debug as... visible. Here is what I added in the plugin.xml,
<extension point="org.eclipse.core.runtime.adapters">
<factory adaptableType="org.eclipse.core.resources.IFile" class=" ">
<adapter type="org.eclipse.debug.ui.actions.ILaunchable">
</adapter>
</factory>
</extension>
我尝试过许多类型的适应类型: IResource
, IFile
,自定义透视图,但没有一个使按钮显示在工具栏上。
I have tried many types of adaptableTypes: IResource
, IFile
, the custom perspective, but none of them make the buttons show up on the toolbar.
推荐答案
您需要使用 org.eclipse.ui.perspectiveExtensions 扩展点。要添加运行和调试按钮,请添加 org.eclipse.debug.ui.launchActionSet actionSet,如下所示:
You need to extend your perspective using org.eclipse.ui.perspectiveExtensions extension point. To add Run and Debug buttons add org.eclipse.debug.ui.launchActionSet actionSet like this:
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="your.perspective.id">
<actionSet
id="org.eclipse.debug.ui.launchActionSet">
</actionSet>
</perspectiveExtension>
</extension>
这篇关于Eclipse插件:将启动命令组添加到自定义透视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!