Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 161693

Summary: [Contributions] Cannot show the items defined in "contributeToCoolBar" function of the ActionBarContributor
Product: [Eclipse Project] Platform Reporter: Shining <nshi_nb>
Component: UIAssignee: Paul Webster <pwebster>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: mvo, prakash
Version: 3.2   
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
My example project
none
Patch v01 none

Description Shining CLA 2006-10-20 03:54:24 EDT
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"?
Comment 1 Shining CLA 2006-10-20 03:57:00 EDT
Created attachment 52376 [details]
My example project

This is my example project to test the coolBarManager.
Comment 2 Paul Webster CLA 2007-04-05 19:05:36 EDT
Assigning to component owner
PW
Comment 3 Prakash Rangaraj CLA 2010-02-02 08:20:47 EST
Created attachment 157898 [details]
Patch v01
Comment 4 Prakash Rangaraj CLA 2010-02-03 00:38:40 EST
Patch v01 released to HEAD