package com.googlecode.jslint4java.eclipse.builder;

import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;

import com.googlecode.jslint4java.eclipse.Activator;

public class JSLintNature implements IProjectNature {

    /**
     * ID of this project nature
     */
    public static final String NATURE_ID = Activator.PLUGIN_ID + ".jsLintNature";

    private IProject project;

    /*
     * (non-Javadoc)
     *
     * @see org.eclipse.core.resources.IProjectNature#configure()
     */
    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(JSLintBuilder.BUILDER_ID))
                return;
        }

        ICommand[] newCommands = new ICommand[commands.length + 1];
        System.arraycopy(commands, 0, newCommands, 0, commands.length);
        ICommand command = desc.newCommand();
        command.setBuilderName(JSLintBuilder.BUILDER_ID);
        newCommands[newCommands.length - 1] = command;
        desc.setBuildSpec(newCommands);
        project.setDescription(desc, null);
    }

    /*
     * (non-Javadoc)
     *
     * @see org.eclipse.core.resources.IProjectNature#deconfigure()
     */
    public void deconfigure() throws CoreException {
        IProjectDescription description = getProject().getDescription();
        ICommand[] commands = description.getBuildSpec();
        for (int i = 0; i < commands.length; ++i) {
            if (commands[i].getBuilderName().equals(JSLintBuilder.BUILDER_ID)) {
                ICommand[] newCommands = new ICommand[commands.length - 1];
                System.arraycopy(commands, 0, newCommands, 0, i);
                System.arraycopy(commands, i + 1, newCommands, i,
                        commands.length - i - 1);
                description.setBuildSpec(newCommands);
                return;
            }
        }
    }

    /*
     * (non-Javadoc)
     *
     * @see org.eclipse.core.resources.IProjectNature#getProject()
     */
    public IProject getProject() {
        return project;
    }

    /*
     * (non-Javadoc)
     *
     * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)
     */
    public void setProject(IProject project) {
        this.project = project;
    }

}

@@ -563,117 +563,8 @@
 t;%0A%0A
-    /*%0A     * (non-Javadoc)%0A     *%0A     * @see org.eclipse.core.resources.IProjectNature#configure()%0A     */%0A
     
@@ -853,16 +853,18 @@
 DER_ID))
+ %7B
 %0A       
@@ -872,32 +872,46 @@
         return;%0A
+            %7D%0A
         %7D%0A%0A     
@@ -1299,119 +1299,8 @@
  %7D%0A%0A
-    /*%0A     * (non-Javadoc)%0A     *%0A     * @see org.eclipse.core.resources.IProjectNature#deconfigure()%0A     */%0A
     
@@ -1988,324 +1988,69 @@
     
-/*%0A     * (non-Javadoc)%0A     *%0A     * @see org.eclipse.core.resources.IProjectNature#getProject()%0A     */%0A    public IProject getProject() %7B%0A        return project;%0A    %7D%0A%0A    /*%0A     * (non-Javadoc)%0A     *%0A     * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)%0A     */
+public IProject getProject() %7B%0A        return project;%0A    %7D%0A
 %0A   

Remove auto-javadoc.