Community
Participate
Working Groups
Hello, I used 2 Coolbar managers in an EditorPart, and I'v let MenuService contribute through Menu Extensions. like this: this.tagToolbarManager = new CoolBarManager(SWT.FLAT); getMenuService().populateContributionManager(this.tagToolbar Manager, TOOLBAR_URI_TAG_EDIOR); this.termsToolbarManager = new CoolBarManager(SWT.FLAT); getMenuService().populateContributionManager(this.termsToolb arManager, TOOLBAR_URI_TERMS_EDITOR); but menu service contributed same toolbar contents for 2 toolbar even each has different Menu URI. Contents seems to merged from contents of two Menu URIs. It works like URIs are same. URIs are "toolbar:termsEditor" and "toolbar:tagsEditor"; I found this on eclipse 3.6, and This problem was not exist on Eclipse 3.4. Reproduce Step: 1. in EditorPart or in ViewPart create two CoolbarManager and let menu service contribute items with different menu URI. 2. Add different command into each menu uri with menu extension. (You have to add parent toolbar node because it is coolbar) 3. run. You will see same contents from two coolbar. OR: 1. Download attachment and import existing project. 2. run plugin. 3. select any file in workspace and select "open with / other.. / internal / Bug Sample Editor" 4. or just open bug sample view.
Created attachment 182955 [details] Screen shot
Created attachment 182956 [details] bug example project
<menuContribution allPopups="false" locationURI="toolbar:example/first"> <toolbar id="group1"> <command commandId="org.eclipse.ui.help.aboutAction" style="push"> </command> </toolbar> </menuContribution> <menuContribution allPopups="false" locationURI="toolbar:example/second"> <toolbar id="group1"> <command commandId="org.eclipse.ui.edit.delete" style="push"> </command> </toolbar> </menuContribution> As per the contribution, the toolbar ids are not unique, so both the contributions are added to the toolbar. This is correct behaviour. Not sure how this was working in 3.4 though. Probably a bug in 3.4 fixed in later releases.
Prakash, That was just my mis typing. Even toolbar ids are not same, result will not change. please try it.
Created attachment 182961 [details] screenshot after toolbar id changed (In reply to comment #4) > Even toolbar ids are not same, > result will not change. I tried with <menuContribution allPopups="false" locationURI="toolbar:example/first"> <toolbar id="group1"> <command commandId="org.eclipse.ui.help.aboutAction" style="push"> </command> </toolbar> </menuContribution> <menuContribution allPopups="false" locationURI="toolbar:example/second"> <toolbar id="group2"> <command commandId="org.eclipse.ui.edit.delete" style="push"> </command> </toolbar> </menuContribution> and get it correctly as in the screenshot.
I specified problem more detail. when toolbar id starts with "toolbar:" It works incorrectly. please try with this again: <extension point="org.eclipse.ui.menus"> <menuContribution allPopups="false" locationURI="toolbar:example/first"> <toolbar id="toolbar:AAA"> <command commandId="org.eclipse.ui.help.aboutAction" style="push"> </command> </toolbar> </menuContribution> <menuContribution allPopups="false" locationURI="toolbar:example/second"> <toolbar id="toolbar:BBB"> <command commandId="org.eclipse.ui.edit.delete" style="push"> </command> </toolbar> </menuContribution> </extension> anyway I can correct my problem now. but I can't sure it's bug or not.
(In reply to comment #6) > <toolbar > id="toolbar:AAA"> The toolbar id isn't a URI and doesn't have to start with "toolbar:"
Thanks, You're right. id is just query part of menu uri. But I think, it also can be start with any string which is just unique. can I close this issue?
(In reply to comment #8) > can I close this issue? Yes, please. PW