Reputation: 63
I'm trying to contribute to the same custom toolbar from two different plugin.xml files. Unfortunately I can't find a way to specify the order in which the buttons appear. The one that is supposed to be the last appears as the first button.
I already tried to specify the insertion position by using
...
MenuManager manager = new MenuManager(null, "my.toolbar.id");
IMenuService menuService = (IMenuService) getEditorSite().getService( IMenuService.class);
manager.add(new GroupMarker("testing"));
menuService.populateContributionManager(manager, "toolbar:my.toolbar.id?after=testing");
...
and in the plugin.xml
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="toolbar:my.toolbar.id?after=testing">
<toolbar id="my.toolbar.id">
<command ...
Does anybody have an idea what could be wrong?
Upvotes: 2
Views: 485
Reputation: 63
I finally figured it out.
In the main plugin.xml file a separator has to be defined on the toolbar where the additional buttons are supposed to be inserted.
In the second plugin.xml file the toolbar contribution should look similar to this:
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="toolbar:my.toolbar.id?after=mainAdditions">
<!-- no toolbar element with id here-->
<command ...
</menuContribution>
where mainAdditions is the name of the separator.
Upvotes: 1