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开发者_JAVA技巧 get it programatically?
Thanks in advance for your help and commitement.
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.
精彩评论