public class ToggleNatureAction implements IObjectActionDelegate {
private IStructuredSelection selection;
public void run(IAction action) {
NatureManager natureManager = new NatureManager();
for (Object obj : selection.toArray()) {
IProject project = projectFromSelectedItem(obj);
if (project != null) {
natureManager.toggleNature(project);
}
}
}