title: How to programatically create a ViewMenu in Eclipse RCP 4
body: <pre><code>    @Inject
      public Widget(MPart part)
      {
          viewMenu = MMenuFactory.INSTANCE.createMenu();
          part.getMenus().add(viewMenu);
      }
  </code></pre>
  
  <p>When I create a Menu or ViewMenu through the .e4xmi file and check the class of the objects, they both return the same classes.  The MMenuFactory only allows me to create an MMenu object.  How would I created a ViewMenu or convert an MMenu object to a ViewMenu?</p>
  
  <p><em>NOTE:</em> The above code does not provide me with a view menu.  Though, when I create a ViewMenu through the .e4xmi file, it shows up in list returned from the getMenus() method.</p>