Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » CoolBarManager/ToolBarManager with contributionItems
CoolBarManager/ToolBarManager with contributionItems [message #1012430] Thu, 21 February 2013 14:41
Eclipse User
Hi,

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();
coolBarManager.add(toolBarManager);

CoolBar coolBar = coolBarManager.createControl(parent);
ToolBar toolBar = toolBarManager.createControl(coolBar);

coolBarManager.update(true);

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
Eclipse?

Best Regards.
Previous Topic:Performance Problems with an IObservableMap and TreeViewer
Next Topic:Databinding of CheckboxTableViewer
Goto Forum:
  


Current Time: Tue Sep 30 13:55:47 GMT 2014

Powered by FUDForum. Page generated in 0.02325 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software