Bug 83059 [RCP] No enablement of perspective menu items
RCP application using factory methods to create menu items for Close Perspective , Close All Perspectives, Reset Perspective, etc. does not maintain enablement state of actions. This code in WorkbenchAdvisor's fillActionBars() method recreates the problem: //Use standard factory methods for actions IWorkbenchAction resetPersAction = ActionFactory.RESET_PERSPECTIVE.create(window); IWorkbenchAction closePersAction = ActionFactory.CLOSE_PERSPECTIVE.create(window); IWorkbenchAction closeAllPersAction = ActionFactory.CLOSE_ALL_PERSPECTIVES.create(window); //Create menu items IMenuManager mgr = configurer.getMenuManager(); MenuManager windowMenu = new MenuManager("&Window", IWorkbenchActionConstants.M_WINDOW); mgr.add(windowMenu); windowMenu.add(resetPersAction); windowMenu.add(closePersAction); windowMenu.add(closeAllPersAction); //Register global actions configurer.registerGlobalAction(resetPersAction); configurer.registerGlobalAction(closePersAction); configurer.registerGlobalAction(closeAllPersAction); I have posted this issue to the RCP news group and received a reply stating that the enablement of these actions should be handled by the RCP developer. However, the ActionFactory API suggests that these actions maintain their enablement state.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkbenchActionBuilder.java
protected void makeActions(final IWorkbenchWindow window) {
        
        statusLineItem = new StatusLineContributionItem("ModeContributionItem"); 
        newWizardAction = ActionFactory.NEW.create(window);
        register(newWizardAction);
        newWizardDropDownAction = IDEActionFactory.NEW_WIZARD_DROP_DOWN
                .create(window);
        register(newWizardDropDownAction);
        importResourcesAction = ActionFactory.IMPORT.create(window);
        register(importResourcesAction);
        exportResourcesAction = ActionFactory.EXPORT.create(window);
        register(exportResourcesAction);
        buildAllAction = IDEActionFactory.BUILD.create(window);
        register(buildAllAction);
        cleanAction = IDEActionFactory.BUILD_CLEAN.create(window);
        register(cleanAction);
        toggleAutoBuildAction = IDEActionFactory.BUILD_AUTOMATICALLY
                .create(window);
        register(toggleAutoBuildAction);
        saveAction = ActionFactory.SAVE.create(window);
        register(saveAction);
        saveAsAction = ActionFactory.SAVE_AS.create(window);
        register(saveAsAction);
        saveAllAction = ActionFactory.SAVE_ALL.create(window);
        register(saveAllAction);
        undoAction = ActionFactory.UNDO.create(window);
        register(undoAction);
        redoAction = ActionFactory.REDO.create(window);
        register(redoAction);
        cutAction = ActionFactory.CUT.create(window);