Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » [SOLVED] How to open a .java file in Eclipse programmatically?
icon10.gif  [SOLVED] How to open a .java file in Eclipse programmatically? [message #649667] Thu, 20 January 2011 03:35 Go to next message
Kivanc Muslu is currently offline Kivanc Muslu
Messages: 153
Registered: November 2010
Senior Member
For those who are interested with the actual solution, please visit: http:// www.eclipse.org/forums/index.php?t=msg&th=203583&unr ead=1&S=8f8e4b034c1c9f1d2752e8381e6abff7

Hi all,

I want to open a .java file in a project in Eclipse's main window (i.e., list of files that you work on) using Eclipse API. It would be the exact correspondence of 'double' clicking that particular file (IFile) using the actual Eclipse as a user.

First of all is this possible (using Eclipse API, I think Eclipse does it itself (while applying some of the quick fixes etc.))? Second, could you show me a start point on what should I search for?

Actually, it would be better for me if I could just simulate whatever internal change is done during this opening process without actually opening the file itself (not sure if this is possible), but just asking.

I need this because I am trying to apply a Change object (by Change.perform(...)), and if the file is not open at the background (i.e., list of file that are being worked on), then the Change is not applied at all (I don't know why, and it somebody could point my why, that would be great knowledge for me).

Thanks in advance, regards,

[Updated on: Thu, 10 February 2011 06:38]

Report message to a moderator

Re: How to open a .java file in Eclipse programmatically? [message #649685 is a reply to message #649667] Thu, 20 January 2011 04:00 Go to previous message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 20.01.2011 09:35, Kivanc Muslu wrote:
> Hi all,
>
> I want to open a .java file in a project in Eclipse's main window
> (i.e., list of files that you work on) using Eclipse API.
See org.eclipse.ui.ide.IDE.openEditor(*).

Dani
> It would be the exact correspondence of 'double' clicking that
> particular file (IFile) using the actual Eclipse as a user.
>
> First of all is this possible (using Eclipse API, I think Eclipse does
> it itself (while applying some of the quick fixes etc.))? Second,
> could you show me a start point on what should I search for?
>
> Actually, it would be better for me if I could just simulate whatever
> internal change is done during this opening process without actually
> opening the file itself (not sure if this is possible), but just asking.
>
> I need this because I am trying to apply a Change object (by
> Change.perform(...)), and if the file is not open at the background
> (i.e., list of file that are being worked on), then the Change is not
> applied at all (I don't know why, and it somebody could point my why,
> that would be great knowledge for me).
>
> Thanks in advance, regards,
Previous Topic: "create project from existing source" issue
Next Topic:How to change wrap column for "source format" operation?
Goto Forum:
  


Current Time: Wed Aug 20 02:50:05 EDT 2014

Powered by FUDForum. Page generated in 0.01785 seconds