/**
  * @param parentManager
  * @param itemModel
  * @param id
  */
 void processDirectItem(MenuManager parentManager, MDirectMenuItem itemModel, String id) {
   IContributionItem ici = getContribution(itemModel);
   if (ici != null) {
     return;
   }
   final IEclipseContext lclContext = getContext(itemModel);
   DirectContributionItem ci =
       ContextInjectionFactory.make(DirectContributionItem.class, lclContext);
   ci.setModel(itemModel);
   ci.setVisible(itemModel.isVisible());
   addToManager(parentManager, itemModel, ci);
   linkModelToContribution(itemModel, ci);
 }
 private void simulateMenuSelection(MMenuItem item) {
   // FIXME: pity this code isn't available through the MMenuItem instance
   // somehow
   IEclipseContext lclContext = getContext(item);
   if (item instanceof MDirectMenuItem) {
     MDirectMenuItem dmi = (MDirectMenuItem) item;
     if (dmi.getObject() == null) {
       IContributionFactory cf =
           (IContributionFactory) lclContext.get(IContributionFactory.class.getName());
       dmi.setObject(cf.create(dmi.getContributionURI(), lclContext));
     }
     lclContext.set(MItem.class.getName(), item);
     ContextInjectionFactory.invoke(dmi.getObject(), Execute.class, lclContext);
     lclContext.remove(MItem.class.getName());
   } else if (item instanceof MHandledMenuItem) {
     MHandledMenuItem hmi = (MHandledMenuItem) item;
     EHandlerService service = (EHandlerService) lclContext.get(EHandlerService.class.getName());
     ParameterizedCommand cmd = hmi.getWbCommand();
     if (cmd == null) {
       cmd = HandledMenuItemRenderer.generateParameterizedCommand(hmi, lclContext);
     }
     lclContext.set(MItem.class.getName(), item);
     service.executeHandler(cmd);
     lclContext.remove(MItem.class.getName());
   } else {
     statusReporter
         .get()
         .report(
             new Status(
                 IStatus.WARNING,
                 CocoaUIProcessor.FRAGMENT_ID,
                 "Unhandled menu type: "
                     + item.getClass()
                     + ": "
                     + item), //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
             StatusReporter.LOG);
   }
 }