views:

89

answers:

1

hi!

I develop an Eclipse plugin project, I started a few days ago and I have a question. My plugin works, my plugin toolbar has a button, named Extract the project. When I click on this button, the plugin writes the names of the open projects from the Package Explorer. How I can get the names of the projects from the package explorer?

I used ISelection, but unfortunately the ISelection object is empty. There are three open projects in package explorer.

Thanks for the answers!

A: 

You do not need the selection. You should start with the workspace root and start from there.

ResourcesPlugin.getWorkspace().getRoot()

If you want to access the Java nature of a project use

JavaCore.create(iProject)
iain