简体   繁体   English

在运行菜单项中添加 Eclipse 默认菜单项

[英]Add Eclipse default menu items in Run Menu Item

I have an RCP application with my own custom perspective.我有一个带有我自己的自定义透视图的 RCP 应用程序。 When I am in eclipse debug perspective I see all the options under Run Menu, but when I switch to my own perspective I see only "External Tools" under Run menu.当我处于 Eclipse 调试视角时,我会看到运行菜单下的所有选项,但是当我切换到我自己的视角时,我只看到运行菜单下的“外部工具”。 How can I enable all the options to be available in Run menu in my custom perspective as well如何在我的自定义透视图中的“运行”菜单中启用所有选项

Here is how it looks in Debug Perspective, I want all these options to be available in my custom perspective这是它在 Debug Perspective 中的外观,我希望所有这些选项都可以在我的自定义透视图中使用

在此处输入图片说明

In your perspective factory add the action sets defined by the debug plugin for these actions:在您的透视工厂中,为这些操作添加由调试插件定义的操作集:

@Override
public void createInitialLayout(IPageLayout layout) {

    ...

    layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
    layout.addActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
}

IDebugUIConstants is org.eclipse.debug.ui.IDebugUIConstants in the org.eclipse.debug.ui plug-in which you will need to add to your plug-ins dependencies. IDebugUIConstantsorg.eclipse.debug.ui.IDebugUIConstantsorg.eclipse.debug.ui插件中,您需要将其添加到插件依赖项中。

If your perspective has already been opened you will need to do a perspective reset to get the new definition.如果您的透视图已经打开,您将需要重新设置透视图以获得新的定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM