public static final String HTML_NATURE_ID = "tk.eclipse.plugin.htmleditor.HTMLProjectNature";
public static final String HTML_BUILDER_ID = "tk.eclipse.plugin.htmleditor.HTMLProjectBuilder";
private IProject project;
public void configure() throws CoreException {
IProjectDescription desc = project.getDescription();
ICommand[] commands = desc.getBuildSpec();
for(int i=0;i<commands.length;i++){
if(commands[i].getBuilderName().equals(HTML_BUILDER_ID)){
return;
}
}
ICommand command = desc.newCommand();
command.setBuilderName(HTML_BUILDER_ID);
ICommand[] newCommands = new ICommand[commands.length + 1];
for(int i=0;i<commands.length;i++){
newCommands[i] = commands[i];
}
newCommands[newCommands.length - 1] = command;
desc.setBuildSpec(newCommands);
project.setDescription(desc,null);
}