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
coolBar.add(new ToolBarContributionItem(fileToolBar,
                    IWorkbenchActionConstants.TOOLBAR_FILE));
        }
        coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
        coolBar.add(new GroupMarker(IIDEActionConstants.GROUP_NAV));
        { 
            IToolBarManager navToolBar = new ToolBarManager(coolBar
                    .getStyle());
            navToolBar.add(new Separator(
                    IWorkbenchActionConstants.HISTORY_GROUP));
            navToolBar
                    .add(new GroupMarker(IWorkbenchActionConstants.GROUP_APP));
            navToolBar.add(backwardHistoryAction);
            navToolBar.add(forwardHistoryAction);
            navToolBar.add(new Separator(IWorkbenchActionConstants.PIN_GROUP));
            navToolBar.add(pinEditorContributionItem);
            
            coolBar.add(new ToolBarContributionItem(navToolBar,
                    IWorkbenchActionConstants.TOOLBAR_NAVIGATE));
        }
        coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR));
     
        coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_HELP)); 
        
        { 
            IToolBarManager helpToolBar = new ToolBarManager(coolBar
                    .getStyle());
            helpToolBar.add(new Separator(IWorkbenchActionConstants.GROUP_HELP)); 
              
            helpToolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_APP));