// Path: src/opaide/natures/OpaProjectNature.java
// public class OpaProjectNature implements IProjectNature {
// 	
// 	public static final String NATURE_ID = "opaide.natures.OpaProjectNature.id"; //$NON-NLS-1$
// 	
// 	private IProject project; 
// 	
// 	@Override
// 	public void configure() throws CoreException {
// 		// TODO Auto-generated method stub
// 		assert(false);
// 	}
// 
// 	@Override
// 	public void deconfigure() throws CoreException {
// 		// TODO Auto-generated method stub
// 
// 	}
// 
// 	@Override
// 	public IProject getProject() {
// 		return project;
// 	}
// 
// 	@Override
// 	public void setProject(IProject project) {
// 		this.project = project;
// 		System.out.println("ProjectNature.setProject()");
// 	}
// 
// }


import opaide.natures.OpaProjectNature;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaMainTab;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.*;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
package opaide.editors.wizard;




public class OpaNewProjectWizard extends Wizard implements INewWizard, IExecutableExtension {
	
	private BasicNewProjectResourceWizard basicWizard;
	//private JavaMainTab j = new org.eclipse.jdt.debug.ui.launchConfigurations.JavaMainTab();

	public OpaNewProjectWizard() {
		super();
		this.basicWizard = new BasicNewProjectResourceWizard();
	}

	@Override
	public void init(IWorkbench workbench, IStructuredSelection selection) {
		basicWizard.init(workbench, selection);
		basicWizard.addPages();
		for (IWizardPage p : basicWizard.getPages()) {
			addPage(p);
			System.out.println("OpaNewWizard.init()");
		}
	}

	@Override
	public boolean performFinish() {
		basicWizard.setContainer(this.getContainer());
		if (basicWizard.performFinish()) {
			//IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
			IProject project = basicWizard.getNewProject();
			try {
				IProjectDescription description = project.getDescription();
				String[] natures = description.getNatureIds () ;
			    String[] newNatures = new String[natures.length + 1] ;
			    System.arraycopy (natures, 0, newNatures, 1, natures.length) ;
// Path: src/opaide/natures/OpaProjectNature.java
// public class OpaProjectNature implements IProjectNature {
// 	
// 	public static final String NATURE_ID = "opaide.natures.OpaProjectNature.id"; //$NON-NLS-1$
// 	
// 	private IProject project; 
// 	
// 	@Override
// 	public void configure() throws CoreException {
// 		// TODO Auto-generated method stub
// 		assert(false);
// 	}
// 
// 	@Override
// 	public void deconfigure() throws CoreException {
// 		// TODO Auto-generated method stub
// 
// 	}
// 
// 	@Override
// 	public IProject getProject() {
// 		return project;
// 	}
// 
// 	@Override
// 	public void setProject(IProject project) {
// 		this.project = project;
// 		System.out.println("ProjectNature.setProject()");
// 	}
// 
// }


// Path: src/opaide/editors/wizard/OpaNewProjectWizard.java
import opaide.natures.OpaProjectNature;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaMainTab;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.*;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;

package opaide.editors.wizard;




public class OpaNewProjectWizard extends Wizard implements INewWizard, IExecutableExtension {
	
	private BasicNewProjectResourceWizard basicWizard;
	//private JavaMainTab j = new org.eclipse.jdt.debug.ui.launchConfigurations.JavaMainTab();

	public OpaNewProjectWizard() {
		super();
		this.basicWizard = new BasicNewProjectResourceWizard();
	}

	@Override
	public void init(IWorkbench workbench, IStructuredSelection selection) {
		basicWizard.init(workbench, selection);
		basicWizard.addPages();
		for (IWizardPage p : basicWizard.getPages()) {
			addPage(p);
			System.out.println("OpaNewWizard.init()");
		}
	}

	@Override
	public boolean performFinish() {
		basicWizard.setContainer(this.getContainer());
		if (basicWizard.performFinish()) {
			//IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
			IProject project = basicWizard.getNewProject();
			try {
				IProjectDescription description = project.getDescription();
				String[] natures = description.getNatureIds () ;
			    String[] newNatures = new String[natures.length + 1] ;
			    System.arraycopy (natures, 0, newNatures, 1, natures.length) ;
			    newNatures[0] = OpaProjectNature.NATURE_ID;