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
import org.eclipse.ui.internal.ide.actions.RetargetActionWithDefault;
import org.eclipse.ui.internal.util.StatusLineContributionItem;
/**
 * Adds actions to a workbench window.
 */
public final class WorkbenchActionBuilder extends ActionBarAdvisor {
    private final IWorkbenchWindow window;
    
    private IWorkbenchAction closeAction;
    private IWorkbenchAction closeAllAction;
    private IWorkbenchAction closeAllSavedAction;
    private IWorkbenchAction saveAction;
    private IWorkbenchAction saveAllAction;
    private IWorkbenchAction helpContentsAction;
    private IWorkbenchAction helpSearchAction;
	
    private IWorkbenchAction dynamicHelpAction;
    
    private IWorkbenchAction aboutAction;
    private IWorkbenchAction openPreferencesAction;
    private IWorkbenchAction saveAsAction;
    private IWorkbenchAction hideShowEditorAction;
    private IWorkbenchAction savePerspectiveAction;
    private IWorkbenchAction resetPerspectiveAction;
    private IWorkbenchAction editActionSetAction;
    private IWorkbenchAction closePerspAction;
    private IWorkbenchAction lockToolBarAction;
    private IWorkbenchAction closeAllPerspsAction;
    private IWorkbenchAction showViewMenuAction;
    private IWorkbenchAction showPartPaneMenuAction;