Search code examples
eclipseeclipse-plugineclipse-rcprcp

How to include Switch Workspace in File menu


I am trying to develop an Eclipse RCP application but I have a problem. I don't know how to implement "switch workspace " in file menu.

Can somebody please help me?


Solution

  • In your RCP ActionBarAdvisor derived class you can create the Switch Workspace action with:

    IWorkbenchAction switchWorkspaceAction = IDEActionFactory.OPEN_WORKSPACE.create(window);
    register(switchWorkspaceAction);
    

    and then add it to a menu manager.

    You will need to have the org.eclipse.ui.ide plugin as a dependency.