Because that's the code used in File -&gt; Open for external files. <br><br>I tried using an ExternalFileEditorInput but it caused problems and would not init the part properly. Nitind told me the file -&gt; open code worked, so I used it.
<br><br>If you actually look at the JavaFileEditorInput code, it's at best a stub implementation with default implementations. It is backed by a JavaFileStorage object, who's javadoc describes it as:&nbsp;&nbsp; * A storage for java.io.File
.<br><br>So I think it is simply named improperly, or misleading. It is not an editor input for java files, but rather, an editor input for java.io.File.<br><br>- Rob<br><br><div><span class="gmail_quote">On 11/30/06, <b class="gmail_sendername">
Max Rydahl Andersen</b> &lt;<a href="mailto:max.andersen@jboss.com">max.andersen@jboss.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Rob,<br><br>how come you are using JavaFileEditorInput for an xml file ?<br><br>just curious.<br><br>/max<br><br>------- Forwarded message -------<br>From: <a href="mailto:bugzilla-daemon@eclipse.org">bugzilla-daemon@eclipse.org
</a><br>To: <a href="mailto:max.andersen@jboss.com">max.andersen@jboss.com</a><br>Cc:<br>Subject: [Bug 166274] Opening external file in xml editor fails<br>Date: Thu, 30 Nov 2006 18:20:23 +0100<br><br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=166274">
https://bugs.eclipse.org/bugs/show_bug.cgi?id=166274</a><br>Product/Component: Web Tools / wst.xml<br><br><br><br><br><br>------- Comment #4 from <a href="mailto:rob.stryker@jboss.com">rob.stryker@jboss.com</a>&nbsp;&nbsp;2006-11-30 12:22 -------
<br>I've switched my code to use that which the file -&gt; open uses. Namely:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;IWorkbench wb = PlatformUI.getWorkbench();<br>&nbsp;&nbsp;&nbsp;&nbsp;IWorkbenchWindow win = wb.getActiveWorkbenchWindow();<br>&nbsp;&nbsp;&nbsp;&nbsp;IWorkbenchPage page = 
win.getActivePage();<br>&nbsp;&nbsp;&nbsp;&nbsp;File file = new File(&quot;C:\\some\\file.xml&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;IFileStore fileStore= EFS.getLocalFileSystem().fromLocalFile(file);<br>&nbsp;&nbsp;&nbsp;&nbsp;if( fileStore != null ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IEditorInput input = new JavaFileEditorInput(fileStore);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IEditorDescriptor desc = PlatformUI.getWorkbench().<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getEditorRegistry().getDefaultEditor(file.getName());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page.openEditor(input, desc.getId());<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>This seems to work fine. Thanks for the help though =]
<br><br><br><br>--<br>--<br>Max Rydahl Andersen<br>callto://max.rydahl.andersen<br><br>Hibernate<br><a href="mailto:max@hibernate.org">max@hibernate.org</a><br><a href="http://hibernate.org">http://hibernate.org</a><br><br>
JBoss a division of Red Hat<br><a href="mailto:max.andersen@jboss.com">max.andersen@jboss.com</a><br><br>_______________________________________________<br>jbosside-dev mailing list<br><a href="mailto:jbosside-dev@lists.jboss.org">
jbosside-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/jbosside-dev">https://lists.jboss.org/mailman/listinfo/jbosside-dev</a><br></blockquote></div><br>