| Summary: | [Contributions] Cannot show the items defined in "contributeToCoolBar" function of the ActionBarContributor | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Shining <nshi_nb> | ||||||
| Component: | UI | Assignee: | 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: |
|
||||||||
Created attachment 52376 [details]
My example project
This is my example project to test the coolBarManager.
Assigning to component owner PW Created attachment 157898 [details]
Patch v01
Patch v01 released to HEAD |
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"?