title: how to programmatically close a eclipse rcp 4 mwindow
body: <p>i create an MWindow at runtime with </p>
  
  <pre><code>MWindow window = _modelService.createModelElement(MWindow.class);
  window.setWidth(200);
  window.setHeight(300);
  // add new Window to the application 
  // @Inject
  // MApplication _application;
  _application.getChildren().add(window);
  </code></pre>
  
  <p>than i add a part to it with</p>
  
  <pre><code>EModelService windowModelService = window.getContext().get(EModelService.class);
  EPartService windowPartService = window.getContext().get(EPartService.class);
  
  // find part if exists
  MPart part = windowPartService.findPart("partId");
  
  if (part == null) {
      // create if not exists
      part = windowPartService.createPart("partId");
  }
  
  
  // Required if initial not visible
  part.setVisible(true);
  
  // Show the part
  MPart newPart = windowPartService.showPart(part, PartState.VISIBLE);
  </code></pre>
  
  <p>but i have no idea how to close or dispose this window after it is no longer used. Mwindow has no close / dispose or exit functions. And if i try to simply remove it from the applications children i get npe.</p>
  
  <p>How to get rid of the window?</p>