Eclipse 插件:将 Launch 命令组添加到 Custom Perspective
我在网上查找了很多教程,但很难找到与 Launches 相关的任何内容。
我正在实现一个 IDE 插件,该插件实现了自定义透视图,但除了“运行最后一个工具”按钮之外,我看不到任何“运行”或“调试”工具栏按钮。每次启动透视图时,我都需要进入“自定义透视图”,然后进入“命令组可见性”并激活“启动命令组”。
我已经实现了 LaunchConfigurationType 并且基本上尝试添加 LaunchShortcuts。
我在某处读到,您需要创建一个 ILaunchable
适配器以使“运行方式...”和“调试方式...”可见。这是我在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>
我尝试了多种类型的adaptableTypes:IResource
,IFile
,自定义透视图,但它们都没有使按钮显示出来在工具栏上。
I have looked for a lot of tutorials online and it is very difficult to find anything related to Launches.
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.
I have implemented a LaunchConfigurationType and am basically trying to add LaunchShortcuts.
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>
I have tried many types of adaptableTypes: IResource
, IFile
, the custom perspective, but none of them make the buttons show up on the toolbar.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用 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: