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
register(cutAction);
        copyAction = ActionFactory.COPY.create(window);
        register(copyAction);
        pasteAction = ActionFactory.PASTE.create(window);
        register(pasteAction);
        printAction = ActionFactory.PRINT.create(window);
        register(printAction);
        selectAllAction = ActionFactory.SELECT_ALL.create(window);
        register(selectAllAction);
        findAction = ActionFactory.FIND.create(window);
        register(findAction);
        closeAction = ActionFactory.CLOSE.create(window);
        register(closeAction);
        closeAllAction = ActionFactory.CLOSE_ALL.create(window);
        register(closeAllAction);
        closeAllSavedAction = ActionFactory.CLOSE_ALL_SAVED.create(window);
        register(closeAllSavedAction);
        helpContentsAction = ActionFactory.HELP_CONTENTS.create(window);
        register(helpContentsAction);
        helpSearchAction = ActionFactory.HELP_SEARCH.create(window);
        register(helpSearchAction);
		
        dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create(window);
        register(dynamicHelpAction);
        
        aboutAction = ActionFactory.ABOUT.create(window);
        aboutAction
                .setImageDescriptor(IDEInternalWorkbenchImages
                        .getImageDescriptor(IDEInternalWorkbenchImages.IMG_OBJS_DEFAULT_PROD));
        register(aboutAction);