[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: FileLink in console with a external file

Julien,

Look at the class OpenLocalFileAction (the code for File->Open File...) in 
the org.eclipse.ui.ide plugin and search for the following.

    IFileStore fileStore = EFS.getLocalFileSystem().getStore(new 
Path(filterPath));

A bit of magic turns the IFileStore into a FileStoreEditorInput which is 
used by your editor. If your editor, like ours, needs to open a plan old 
file you can turn the FileStoreEditorInput into an IPath in your 
IAdapterFactory. It would look something like this:

    URI uri = ((FileStoreEditorInput) adaptableObject).getURI();
    IPath path = URIUtil.toPath(uri);
    File file = new File(path.toString());

David Kyle
http://richclientplatform.blogspot.com/