Search code examples
javaeclipseeclipse-plugineclipse-rcprcp

Add Eclipse default menu items in Run Menu Item


I have an RCP application with my own custom perspective. 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. 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

enter image description here


Solution

  • 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.

    If your perspective has already been opened you will need to do a perspective reset to get the new definition.