void processOpaqueItem(ToolBarManager parentManager, MOpaqueToolItem itemModel) {
   IContributionItem ici = getContribution(itemModel);
   if (ici != null) {
     return;
   }
   Object obj = itemModel.getOpaqueItem();
   if (obj instanceof IContributionItem) {
     ici = (IContributionItem) obj;
   } else {
     return;
   }
   ici.setVisible(itemModel.isVisible());
   addToManager(parentManager, itemModel, ici);
   linkModelToContribution(itemModel, ici);
 }
  public void reconcileManagerToModel(IToolBarManager menuManager, MToolBar toolBar) {
    List<MToolBarElement> modelChildren = toolBar.getChildren();
    HashSet<MOpaqueToolItem> oldModelItems = new HashSet<MOpaqueToolItem>();
    for (MToolBarElement itemModel : modelChildren) {
      if (itemModel instanceof MOpaqueToolItem) {
        oldModelItems.add((MOpaqueToolItem) itemModel);
      }
    }

    IContributionItem[] items = menuManager.getItems();
    for (int src = 0, dest = 0; src < items.length; src++, dest++) {
      IContributionItem item = items[src];
      MToolBarElement element = getToolElement(item);
      if (element == null) {
        MOpaqueToolItem legacyItem = MenuFactoryImpl.eINSTANCE.createOpaqueToolItem();
        legacyItem.setElementId(item.getId());
        legacyItem.setVisible(item.isVisible());
        legacyItem.setOpaqueItem(item);
        linkModelToContribution(legacyItem, item);
        modelChildren.add(dest, legacyItem);
      } else if (element instanceof MOpaqueToolItem) {
        MOpaqueToolItem legacyItem = (MOpaqueToolItem) element;
        oldModelItems.remove(legacyItem);
        if (modelChildren.size() > dest) {
          if (modelChildren.get(dest) != legacyItem) {
            modelChildren.remove(legacyItem);
            modelChildren.add(dest, legacyItem);
          }
        } else {
          modelChildren.add(legacyItem);
        }
      }
    }

    if (!oldModelItems.isEmpty()) {
      modelChildren.removeAll(oldModelItems);
      for (MOpaqueToolItem model : oldModelItems) {
        clearModelToContribution(model, (IContributionItem) model.getOpaqueItem());
      }
    }
  }