|CoolBarManager/ToolBarManager with contributionItems [message #1012430]
||Thu, 21 February 2013 14:41
I have a editor which have its own toolbar using a ToolBarManager whose
actions are contributed by "org.eclipse.ui.menus" extension point in
plugin.xml through ExtensionContributionFactory to create IContributionItem.
Now when the editor width is not enough large to display all toolbar
actions, we want to have not visible actions accessible through a
chevron drop down menu action. To do that I have seen that the
CoolBarManager could be used with the ToolBarManager. Then in the
IEditorPart.createPartControl() of my editor, I do the following :
CoolBarManager coolBarManager = new CoolBarManager();
ToolBarManager toolBarManager = new ToolBarManager();
CoolBar coolBar = coolBarManager.createControl(parent);
ToolBar toolBar = toolBarManager.createControl(coolBar);
But with that now the toolbar is not visible, if I set a blue color to
the coolbar I see a blue line. The coolBar and toolBar are created but
not ToolItem and CoolItem are created for the contributed actions.
When debugging I see that the ToolBarManager.update() is called directly
by the WorkbenchMenuService.updateManagers() whithout calling the
CoolBarManager. How can I have the WorkbenchMenuService.updateManagers()
calls CoolBarManager.update() to have my CoolItem created?
When I calls directly "coolBarManager.update(true);" the only
contribution of this CoolBarManager, i.e. ToolBarContributionItem, will
call ToolBarManager.update(true) to have this last creates the ToolItem
for each ContributionItem. After that the ToolBarContributionItem will
create a CoolItem if the ToolBarManager have ToolItem created but it is
not the case here.
Is there exists some examples of use of CoolBarManager with jface in
Powered by FUDForum
. Page generated in 0.02107 seconds