Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How do I open an editor programmatically in Eclipse Helios(Opening editors programmatically)
icon8.gif  How do I open an editor programmatically in Eclipse Helios [message #1013433] Sat, 23 February 2013 11:43 Go to next message
John Jhonson is currently offline John Jhonson
Messages: 2
Registered: October 2011
Junior Member
Hi everyone, I'm working with Eclipse Helios Service Release 2. I've been trying for a while to open an editor programmatically. Basically I need to create a file dynamically and then open the corresponding editor in Eclipse.

I was trying to do something like it's detailed here: http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_programmatically%3F, but in this line:

EFS.getLocalFileSystem().getStore(fileToOpen.toURI());


I get a NPE, here is the log:
Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.eclipse.core.filesystem.EFS.getLocalFileSystem(EFS.java:439)
	at org.eclipse.pde.uiimpact.refactoring.handlers.Test.createFile(Test.java:42)
	at org.eclipse.pde.uiimpact.refactoring.handlers.Test.main(Test.java:27)
Caused by: java.lang.NullPointerException
	at org.eclipse.core.internal.filesystem.InternalFileSystemCore.<init>(InternalFileSystemCore.java:49)
	at org.eclipse.core.internal.filesystem.InternalFileSystemCore.<clinit>(InternalFileSystemCore.java:25)
	... 3 more



This is giving me such a hard time, the example of that FAQ is for Eclipse 3.3, I'm not sure if something should be different for Helios. I just can't find anything that works for me.

I'd really appreciate if anybody can help me.


Thanks!!
Re: How do I open an editor programmatically in Eclipse Helios [message #1014627 is a reply to message #1013433] Tue, 26 February 2013 02:23 Go to previous message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 23.02.2013 17:43, John Jhonson wrote:
> Hi everyone, I'm working with Eclipse Helios Service Release 2. I've
> been trying for a while to open an editor programmatically. Basically
> I need to create a file dynamically and then open the corresponding
> editor in Eclipse.
> I was trying to do something like it's detailed here:
> http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_programmatically%3F,
> but in this line:
>
> EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
>
> I get a NPE, here is the log:
> Exception in thread "main" java.lang.ExceptionInInitializerError
> at org.eclipse.core.filesystem.EFS.getLocalFileSystem(EFS.java:439)
> at
> org.eclipse.pde.uiimpact.refactoring.handlers.Test.createFile(Test.java:42)
> at
> org.eclipse.pde.uiimpact.refactoring.handlers.Test.main(Test.java:27)
> Caused by: java.lang.NullPointerException
> at
> org.eclipse.core.internal.filesystem.InternalFileSystemCore.<init>(InternalFileSystemCore.java:49)
> at
> org.eclipse.core.internal.filesystem.InternalFileSystemCore.<clinit>(InternalFileSystemCore.java:25)
> ... 3 more
>
>
> This is giving me such a hard time, the example of that FAQ is for
> Eclipse 3.3, I'm not sure if something should be different for Helios.
> I just can't find anything that works for me.
>
Looks like you start your app as normal 'Java Application' instead of as
'Eclipse Application'.

Dani
> I'd really appreciate if anybody can help me.
>
>
> Thanks!!
>
Previous Topic:Is Juno SR2 GA being delayed?
Next Topic:Enum in Eclipse Scrapbook
Goto Forum:
  


Current Time: Fri Jul 25 05:16:56 EDT 2014

Powered by FUDForum. Page generated in 0.02315 seconds