Project: Eclipse_Platform_UI
Bug 161693 [Contributions] Cannot show the items defined in "contributeToCoolBar" function of the ActionBarContributor
Reported: 2006-10-20 03:54:24 | Status: resolved fixed

I am trying to add a few items on the WorkbenchWindow toolbar. I try to do this by define an ActionBarContributor class and configurer it in the plugin.xml. In my ActionBarContributor class, I write the following test code, but nothing happened. =============================================================================== @Override public void contributeToCoolBar(ICoolBarManager coolBarManager) { // TODO Auto-generated method stub super.contributeToCoolBar(coolBarManager); IToolBarManager sqlEditorBar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); { sqlEditorBar.add(ActionFactory.SAVE_ALL.create(this.getPage().getWorkbenchWindow())); } coolBarManager.add(new ToolBarContributionItem(sqlEditorBar, "SQLEditorBar")); } =============================================================================== I also tried to override the contributeToToolBar(IToolBarManager toolBarManager) function, it seems work well. By tracking the code, I think that the "private void setVisible(boolean visible, boolean forceVisibility)" in the "EditorActionBars.java" would less control to the coolBarMgr. I am not totaly clear the complex mechanism of the control to the contributeItem of the coolbarManager and the difference between "contributeToToolBar" and "contributeToCoolBar". Can anybody tell me when to use "contributeToToolBar" and when to user "contributeToCoolBar"?

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/EditorActionBarsTest.java