Project: Eclipse_Platform_UI
Bug 231341 [Commands] Menu disappears when dialog pops up
Reported: 2008-05-09 13:35:31 | Status: resolved fixed

When a dialog pops up, a main menu with a visibleWhen clause involving activeEditorId disappears. It can be reproduced with this code: WithExpression w = new WithExpression("activeEditorId"); EqualsExpression e = new EqualsExpression( "org.eclipse.ui.DefaultTextEditor"); w.add(e); IEvaluationReference ref = es.addEvaluationListener(w, listener, "foo"); WorkbenchWindowExpression wwe = new WorkbenchWindowExpression(getSite() .getPage().getWorkbenchWindow()); rs.addEvaluationListener(wwe, new RestrictionListener(ref), IRestrictionService.PROP_NOTIFYING); The active editor source is evaluated before the active shell source, so the foo property changes and then is restricted from posting changes. This will be a problem with all sources that change in uncontrolled orders, I'm not sure what to do here. PW

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DetachedWindow.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/ContributionRoot.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/InternalMenuService.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuServiceFactory.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/SlaveMenuService.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/TrimContributionManager.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ActivePartSourceProvider.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ActiveShellSourceProvider.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/CurrentSelectionSourceProvider.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/EvaluationService.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/IRestrictionService.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/RestrictionListener.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/services/EvaluationServiceTest.java