Skip to main content


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 08:35 Go to next message
Kivanc Muslu is currently offline Kivanc MusluFriend
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 11: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 09:00 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
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: Thu Mar 28 13:32:01 GMT 2024

Powered by FUDForum. Page generated in 0.04874 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top