

package cz.karry.dop.nbmodule.project;

import java.io.IOException;

import org.netbeans.api.project.Project;
import org.netbeans.spi.project.support.ant.AntBasedProjectType;
import org.netbeans.spi.project.support.ant.AntProjectHelper;


public final class DopProjectType implements AntBasedProjectType {
    
    public static final String TYPE = DopProjectType.class.getPackage().getName();
    
    private static final String PROJECT_CONFIGURATION_NAME      = "data"; // NOI18N
    
    public static final String PROJECT_CONFIGURATION_NAMESPACE  = 
            "http://www.netbeans.org/ns/j2se-project/3";                   // NOI18N
    
    private static final String PRIVATE_CONFIGURATION_NAME      = "data"; // NOI18N
    
    private static final String PRIVATE_CONFIGURATION_NAMESPACE = 
             "http://www.netbeans.org/ns/php-project-private/1";          // NOI18N

    /* (non-Javadoc)
     * @see org.netbeans.spi.project.support.ant.AntBasedProjectType#createProject(org.netbeans.spi.project.support.ant.AntProjectHelper)
     */
    public Project createProject( AntProjectHelper helper ) throws IOException {
        return new DopProject( helper );
    }

    /* (non-Javadoc)
     * @see org.netbeans.spi.project.support.ant.AntBasedProjectType#getPrimaryConfigurationDataElementName(boolean)
     */
    public String getPrimaryConfigurationDataElementName( boolean shared ) {
        /*
         * Copied from MakeProjectType.
         */
        return shared ? PROJECT_CONFIGURATION_NAME : PRIVATE_CONFIGURATION_NAME;
    }

    /* (non-Javadoc)
     * @see org.netbeans.spi.project.support.ant.AntBasedProjectType#getPrimaryConfigurationDataElementNamespace(boolean)
     */
    public String getPrimaryConfigurationDataElementNamespace( boolean shared ) {
        /*
         * Copied from MakeProjectType.
         */
        return shared ? PROJECT_CONFIGURATION_NAMESPACE : 
                                PRIVATE_CONFIGURATION_NAMESPACE;
    }

    /* (non-Javadoc)
     * @see org.netbeans.spi.project.support.ant.AntBasedProjectType#getType()
     */
    public String getType() {
        return TYPE;
    }

}
