Project: Eclipse_Platform_UI
Bug 202187 [Contributions] WorkbenchWindowControlContribution getWorkbenchWindow returns null
Reported: 2007-09-04 14:30:40 | Status: verified fixed

Build ID: I20070621-1340 The getWorkbenchWindow method in WorkbenchWindowControlContribution returns null for control contributions to the global toolbar. Steps To Reproduce: 1. Create a control contribution that extends from WorkbenchWindowControlContribution. 2. In the createControl method call getWorkbenchWindow. This will be null at runtime. 3. Add the control contribution to a toolbar via the org.eclipse.ui.menus ext point. 4. Run the application and the call to getWorkbenchWindow will be null. More information: I put a break point in InternalControlContribution.setWorkbenchWindow(IWorkbenchWindow) and debugged, but never saw it get called. I noticed TrimContributionManager calls this setWorkbenchWindow method, but that is used for Trim contributions, whereas I'm doing a toolbar contribution.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java