Source:
<code>private void fill(MToolBar container, IContributionManager manager) { ToolBarManagerRenderer renderer = (ToolBarManagerRenderer) rendererFactory.getRenderer( container, null); for (IContributionItem item : manager.getItems()) { if (item == null) { continue; } MToolBarElement toolBarElem = renderer.getToolElement(item); if (toolBarElem != null) { if (container.isVisible()) { setChildVisible(toolBarElem, item, manager); } continue; } if (item instanceof IToolBarContributionItem) { IToolBarManager manager2 = ((IToolBarContributionItem) item).getToolBarManager(); fill(container, manager2); } else if (item instanceof IMenuManager) { continue; } else if (item instanceof IContributionManager) { fill(container, (IContributionManager) item); } else if (item instanceof CommandContributionItem) { CommandContributionItem cci = (CommandContributionItem) item; MToolItem toolItem = MenuHelper.createToolItem(application, cci); <START> if (toolItem != null) { <END> renderer.linkModelToContribution(toolItem, item); container.getChildren().add(toolItem); } } else { MToolItem toolItem = OpaqueElementUtil.createOpaqueToolItem(); toolItem.setElementId(item.getId()); OpaqueElementUtil.setOpaqueItem(toolItem, item); if (item instanceof AbstractGroupMarker) { toolItem.setVisible(item.isVisible()); } renderer.linkModelToContribution(toolItem, item); container.getChildren().add(toolItem); } } }</code><technical_language>This breaks model, need renderer create a HandledContributionItem</technical_language>

Target:
private void fill(MToolBar container, IContributionManager manager) { ToolBarManagerRenderer renderer = (ToolBarManagerRenderer) rendererFactory.getRenderer( container, null); IContributionItem[] items = manager.getItems(); for (int index = 0; index < items.length; index++) { IContributionItem item = items[index]; if (item == null) { continue; } MToolBarElement toolBarElem = renderer.getToolElement(item); if (toolBarElem != null) { if (container.isVisible()) { setChildVisible(toolBarElem, item, manager); } continue; } if (item instanceof IToolBarContributionItem) { IToolBarManager manager2 = ((IToolBarContributionItem) item).getToolBarManager(); fill(container, manager2); } else if (item instanceof IMenuManager) { continue; } else if (item instanceof IContributionManager) { fill(container, (IContributionManager) item); } else if (item instanceof CommandContributionItem) { MHandledToolItem toolItem = MenuHelper.createToolItem(application, (CommandContributionItem) item); if (toolItem == null) { continue; } toolItem.setRenderer(renderer); HandledContributionItem ci = ContextInjectionFactory.make(HandledContributionItem.class, window.getContext()); if (manager instanceof ContributionManager) { ContributionManager cm = (ContributionManager) manager; cm.insert(index, ci); cm.remove(item); } ci.setModel(toolItem); ci.setVisible(toolItem.isVisible()); renderer.linkModelToContribution(toolItem, ci); container.getChildren().add(toolItem); } else { MToolItem toolItem = OpaqueElementUtil.createOpaqueToolItem(); toolItem.setElementId(item.getId()); OpaqueElementUtil.setOpaqueItem(toolItem, item); if (item instanceof AbstractGroupMarker) { toolItem.setVisible(item.isVisible()); } renderer.linkModelToContribution(toolItem, item); container.getChildren().add(toolItem); } } }