Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Opening External File in Eclipse3
Opening External File in Eclipse3 [message #255652] Fri, 25 June 2004 16:42 Go to next message
S Dix is currently offline S DixFriend
Messages: 43
Registered: July 2009
Member
Hello all,

Previously in Eclipse 2.x there was no way to open an external file which
is not the part of the project. But now that seems to be possible in
Eclipse3 using the File -> Open External File...

My question is as the functionality is provided there would be some
mechanism to do that using the api's too. I couldn't get it how to go
about doing the same.
Currently I am copying the external file into the project location,
refresh the project and then get IFile and then open the file. I am sure
there is a better means to handle the same. This is the code snippet how I
get the IFile

IProject ipProject = selectedResources[0].getProject();
//refresh the project to bring in the test cases created
ipProject.refreshLocal(IResource.DEPTH_INFINITE, null);
final IFile fileToOpen =
ResourcesPlugin.getWorkspace().getRoot().getFileForLocation( new
Path(fileName));

Any help is appreciated.

Thanks in advance
Re: Opening External File in Eclipse3 [message #255793 is a reply to message #255652] Fri, 25 June 2004 22:40 Go to previous message
Eclipse UserFriend
Originally posted by: ed.burnette.REMOVE.THIS.sas.com

Look at the source code for
org.eclipse.ui.internal.editors.text.OpenExternalFileAction (through CVS or
by doing a binary import of the org.eclipse.ui.editors plug-in).

--
Ed Burnette, co-author, Eclipse in Action
www.eclipsepowered.org

"S Dixit" <siddhi1972@yahoo.com> wrote in message
news:cbhkks$524$1@eclipse.org...
> Hello all,
>
> Previously in Eclipse 2.x there was no way to open an external file which
> is not the part of the project. But now that seems to be possible in
> Eclipse3 using the File -> Open External File...
>
> My question is as the functionality is provided there would be some
> mechanism to do that using the api's too. I couldn't get it how to go
> about doing the same.
Previous Topic:Where is the final 3.0 Release of Eclispe?
Next Topic:EPL License?
Goto Forum:
  


Current Time: Thu Dec 26 14:39:57 GMT 2024

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

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

Back to the top