Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Getting File instance form the IEditorInput instance
Getting File instance form the IEditorInput instance [message #279690] Fri, 21 January 2005 10:57 Go to next message
Eclipse UserFriend
Hello,
I would like to create a java.io.File from the IEditorInput instance
provided as argument in the EditorPart.init method..
The way I found to do this is quite inelegant :

....
IFile anIFile = ((IFileEditorInput)editorInput).getFile();
File aFile =
(File)(anIFile.getWorkspace().getRoot().getLocation().append (anIFile.getFullPath()).toFile());

Is there a better way to do this?

best regards
Xavier
Re: Getting File instance form the IEditorInput instance [message #279698 is a reply to message #279690] Fri, 21 January 2005 13:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chaves.inf.no.ufsc.spam.br

((IFileEditorInput)editorInput).getFile().getLocation() is enough.

Rafael

Xavier Mehaut wrote:
> Hello,
> I would like to create a java.io.File from the IEditorInput instance
> provided as argument in the EditorPart.init method..
> The way I found to do this is quite inelegant :
>
> ...
> IFile anIFile = ((IFileEditorInput)editorInput).getFile();
> File aFile =
> (File)(anIFile.getWorkspace().getRoot().getLocation().append (anIFile.getFullPath()).toFile());
>
>
> Is there a better way to do this?
>
> best regards
> Xavier
Re: Getting File instance form the IEditorInput instance [message #279703 is a reply to message #279698] Fri, 21 January 2005 14:50 Go to previous message
Eclipse UserFriend
Yes indeed ;)
Thanks
regards

Rafael Chaves a écrit :
> ((IFileEditorInput)editorInput).getFile().getLocation() is enough.
>
> Rafael
>
> Xavier Mehaut wrote:
>
>> Hello,
>> I would like to create a java.io.File from the IEditorInput instance
>> provided as argument in the EditorPart.init method..
>> The way I found to do this is quite inelegant :
>>
>> ...
>> IFile anIFile = ((IFileEditorInput)editorInput).getFile();
>> File aFile =
>> (File)(anIFile.getWorkspace().getRoot().getLocation().append (anIFile.getFullPath()).toFile());
>>
>>
>> Is there a better way to do this?
>>
>> best regards
>> Xavier
>
>
>
Previous Topic:Remove from repository
Next Topic:CVS: bad auth protocol end
Goto Forum:
  


Current Time: Sat May 10 19:20:43 EDT 2025

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

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

Back to the top