package jp.ac.kyutech.ai.ylab.shiva.nativecapable.plugin.nature;

import jp.ac.kyutech.ai.ylab.shiva.nativecapable.plugin.properties.NativeCapableJavaProjectPropertyPage;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;

public class NativeCapableJavaProjectNature implements IProjectNature {

	@Override
	public void configure() throws CoreException {
		System.out.println("NativeCapableJavaProjectNature#configure");

	}

	@Override
	public void deconfigure() throws CoreException {
		System.out.println("NativeCapableJavaProjectNature#deconfigure");

	}

	@Override
	public IProject getProject() {
		System.out.println("NativeCapableJavaProjectNature#getProject");
		return null;
	}

	@Override
	public void setProject(IProject project) {
		System.out.println("NativeCapableJavaProjectNature#setProject");
		// store values

		try {
			String srcFolder = project.getPersistentProperty(new QualifiedName(
					"", NativeCapableJavaProjectPropertyPage.SRC_DIR_PROPERTY));
			String libFolder = project.getPersistentProperty(new QualifiedName(
					"", NativeCapableJavaProjectPropertyPage.LIB_DIR_PROPERTY));
			String binFolder = project.getPersistentProperty(new QualifiedName(
					"", NativeCapableJavaProjectPropertyPage.BIN_DIR_PROPERTY));

			System.out.println(srcFolder);

			System.out.println(libFolder);

			System.out.println(binFolder);
		} catch (CoreException e) {
			e.printStackTrace();
		}

		// final IJavaProject javaProject = JavaCore.create(project);

	}

}
