views:

33

answers:

1

Hello,

I'm developing an Eclipse pluging which is executed when I right clik on a project in Project Explorer view and choose my option in the menu. The thing is that I need to get location of the selected project. I mean location on disk. When you right click on any project and go to Properties there is always Location listed. Do you know any way to get it programatically?

Thanks in advance for your help and commitement.

+1  A: 

If you have the name of the currently selected project

IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("foo");
String fullpath = project.getFullPath();

You can also get the project through the selection service: see this SO question as an example.

VonC
see also this thread: http://dev.eclipse.org/newslists/news.eclipse.platform/msg67567.html
VonC