private void setProjectNatures(IProject project, IFeatureModel model, IProgressMonitor monitor) throws CoreException { IProjectDescription desc = project.getDescription(); if (needsJavaNature(model)) { desc.setNatureIds(new String[] {JavaCore.NATURE_ID, MDE.FEATURE_NATURE}); } else { desc.setNatureIds(new String[] {MDE.FEATURE_NATURE}); } project.setDescription(desc, new SubProgressMonitor(monitor, 1)); }
private boolean hasJavaBuilder(IProject project) throws CoreException { ICommand[] buildCommands = project.getDescription().getBuildSpec(); for (int i = 0, l = buildCommands.length; i < l; i++) if (buildCommands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) return true; return false; }