title: Eclipse plugin development - e4 part with input: instantiate input
body: <p>Eclipse 4 does not have any notion of an editor, only parts. So how do we receive the file for our "editor" parts? I'm talking about an e4 equivalent of the <code>IEditorPart.init</code> method, and the <code>IEditorInput</code> it receives.</p>
  
  <p>I've stumbled upon <a href="https://eclipse.googlesource.com/e4/org.eclipse.e4.ui/+/integration/examples?autodive=0%2F%2F" rel="nofollow noreferrer">this example </a> by Tom Schindl. He is able to inject the input in the part constructor. For the input object to be available for injection, it has to be instantiated in the <code>IEclipseContext</code> somehow. <a href="http://modelmoo.blogspot.no/2013/04/eclipse-modeling-framework-ui-e4.html" rel="nofollow noreferrer">This article</a> refers to Schindl's example, and leads me to consider the following approach: intercept "Open file" commands (if they exist) from the Eclipse platform, create an input instance for the "editor" part and put it in the context (<code>IEcpliseContext.set(class, value)</code>), and open the part with the <code>EPartService</code>.</p>
  
  <p>So the question is: is this the right approach to creating an e4 "editor"? And is it possible to implement?</p>