Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] obtain full path from ISourceModule

DLTKCore.create(), I have forgot to mention it, sorry.

On Tue, Oct 21, 2008 at 07:06, Jae Gangemi <jgangemi@xxxxxxxxx> wrote:

  thanks again alex!

  if i wanted to then find corresponding IModelElement for that entry, will the project.findElement(IPath) work? (i'd imagine that i probably have to take the IFile from the getFileForLocation call and convert that back to a path).


On Mon, Oct 20, 2008 at 7:38 PM, Alexey Panchenko <alex.panchenko@xxxxxxxxx> wrote:
To find workspace resources you can use
IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(IPath path);



On Tue, Oct 21, 2008 at 05:32, Jae Gangemi <jgangemi@xxxxxxxxx> wrote:

  p.s. i tried using the 'findElement' method off the IScriptProject object, but i get 'null' when i specifiy the full path and if i start shrinking it down, the method call starts taking more time to complete.


On Mon, Oct 20, 2008 at 6:30 PM, Jae Gangemi <jgangemi@xxxxxxxxx> wrote:

  thanks alex!

  i have another question, if i have the full path to a resource that exists on disk, how can i find it's corresponding ISourceModule object? i'm working tracking dependencies for my compiler/validator and i need to be able to lookup the dependant resources so i can clear there markers and recompile them as well.


On Mon, Oct 20, 2008 at 12:48 PM, Alexey Panchenko <alex.panchenko@xxxxxxxxx> wrote:
Hi Jae,

Something like the following:

IResource resource = module.getResource()
if (resource != null) {
  //workspace
  return resource.getLocation(); // could be null
}
else if (module instanceof IExternalSourceModule) {
  IFileHandle file = EnvironmentPathUtils.getFile(module.getPath())
  if (file != null) {
   return file.toOSString()
  }
}

Regards,
Alex



On Mon, Oct 20, 2008 at 22:17, Jae Gangemi <jgangemi@xxxxxxxxx> wrote:
hello all -

  how can i obtain the full path to the underlying resource for an ISourceModule?

  i see that the object already has a getPath() call, but those that just returnst the inner most element (ie: perl/lib/Foo.pm'), but i would like the full path on disk ('/Users/jae/projects/pde-test/perl/lib/Foo.pm')

  thanks!

--
-jae

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev



_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev




--
-jae



--
-jae

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev



_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev




--
-jae

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev



Back to the top