title: Eclipse: How to open an editor programmatically
body: <p>I'm wondering how I can open an editor programmatically. I first created the appropriated file and then I want to open the editor for this type of file. But I'm not able to open the editor then.</p>
  
  <pre><code>...
  IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  PlcEditor editor = new PlcEditor(emfResource);
  page.openEditor(editor, "test");
  ...
  </code></pre>
  
  <p>I already had the following solution (which works), but here I wasn't able to call the constructr of my editor:</p>
  
  <pre><code>....
  IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  IEditorPart openEditor = IDE.openEditor(page, plcFile);
  ....
  </code></pre>