Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Path of project!!!
Path of project!!! [message #185447] Sat, 25 June 2005 07:20 Go to next message
Eclipse UserFriend
Originally posted by: gautamn.iitk.ac.in

Hi,
I am making a editor using GEF...How can I access the location of my
source files. Suppose my source files are in directory
"C:\kuda\24MAY\SADP1".
How can I get this string???
Regards,
Nitin.
Re: Path of project!!! [message #185552 is a reply to message #185447] Mon, 27 June 2005 05:30 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Nitin Gautam wrote:
>
> Hi,
> I am making a editor using GEF...How can I access the location of my
> source files. Suppose my source files are in directory
> "C:\kuda\24MAY\SADP1".
> How can I get this string???
> Regards,
> Nitin.
>
In your derived EditorPart.setInput(IEditorInput input) try

IFile file = ((IFileEditorInput)input).getFile();
URI uri = URI.createPlatformResourceURI(file.getFullPath().toString()) ;

Regards

Ed Willink
Re: Path of project!!! [message #185794 is a reply to message #185552] Thu, 30 June 2005 06:07 Go to previous message
Dazhen Gao is currently offline Dazhen GaoFriend
Messages: 21
Registered: July 2009
Junior Member
another way:
IFile file = ((IFileEditorInput)input).getFile();
String fullPath = file.getLocation( ).toOSString( )
if you through the FileDialog ,code example
FileDialog fileChooser = new FileDialog( getShell( ), SWT.OPEN );
String fullPath = fileChooser.open( );

"Ed Willink" <ed@willink.me.uk> wrote in message
news:d9o2t7$rn$1@news.eclipse.org...
> Nitin Gautam wrote:
>>
>> Hi,
>> I am making a editor using GEF...How can I access the location of my
>> source files. Suppose my source files are in directory
>> "C:\kuda\24MAY\SADP1".
>> How can I get this string??
>> Regards,
>> Nitin.
>>
> In your derived EditorPart.setInput(IEditorInput input) try
>
> IFile file = ((IFileEditorInput)input).getFile();
> URI uri = URI.createPlatformResourceURI(file.getFullPath().toString()) ;
>
> Regards
>
> Ed Willink
Previous Topic:How to select nearest figure when clicking on parent
Next Topic:No more handles Unhandled event loop exception
Goto Forum:
  


Current Time: Thu Dec 12 17:28:38 GMT 2024

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

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

Back to the top