Project: Eclipse_Platform_UI
Bug 50033 [Contributions] Context change notifications not sent
Reported: 2004-01-14 18:12:11 | Status: closed fixed

Build 20031113 It seems that the various context listener API (of which there are a confusing number) don't send notifications when contexts are activated. When my real implementation of a listener wasn't getting called, I tried the following code. The listener in this example is never called. org.eclipse.ui.contexts.IMutableContextManager manager= org.eclipse.ui. contexts.ContextManagerFactory.getMutableContextManager(); org.eclipse.ui.contexts.IContext context= manager.getContext("org. eclipse.jdt.debug.debugging"); context.addContextListener(new org.eclipse.ui.contexts. IContextListener() { public void contextChanged(org.eclipse.ui.contexts.ContextEvent contextEvent) { System.out.println("Context changed"); } }); java.util.HashSet set= new java.util.HashSet(); set.add("org.eclipse.jdt.debug.debugging"); manager.setEnabledContextIds(set);

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/MutableContextManager.java