|
14 | 14 | import org.eclipse.core.resources.IFile;
|
15 | 15 | import org.eclipse.core.resources.IProject;
|
16 | 16 | import org.eclipse.core.resources.IProjectDescription;
|
| 17 | +import org.eclipse.core.resources.IWorkspace; |
17 | 18 | import org.eclipse.core.resources.IncrementalProjectBuilder;
|
18 | 19 | import org.eclipse.core.resources.ResourcesPlugin;
|
19 | 20 | import org.eclipse.core.runtime.CoreException;
|
|
33 | 34 | import org.eclipse.ui.internal.registry.PerspectiveDescriptor;
|
34 | 35 | import org.eclipse.ui.wizards.datatransfer.ImportOperation;
|
35 | 36 | import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
|
| 37 | +import org.eclipse.wst.jsdt.core.JavaScriptCore; |
36 | 38 | import org.nodeclipse.ui.Activator;
|
| 39 | +import org.nodeclipse.ui.nature.NodeNature; |
37 | 40 | import org.nodeclipse.ui.perspectives.NodePerspective;
|
38 | 41 | import org.osgi.framework.Bundle;
|
39 | 42 |
|
@@ -76,6 +79,21 @@ public boolean performFinish() {
|
76 | 79 | }
|
77 | 80 |
|
78 | 81 | protected abstract IProject createNewProject();
|
| 82 | + |
| 83 | + protected IProjectDescription createProjectDescription(IProject newProjectHandle, URI location) { |
| 84 | + IWorkspace workspace = ResourcesPlugin.getWorkspace(); |
| 85 | + final IProjectDescription description = workspace |
| 86 | + .newProjectDescription(newProjectHandle.getName()); |
| 87 | + description.setLocationURI(location); |
| 88 | + String[] natures = description.getNatureIds(); |
| 89 | + String[] newNatures = new String[natures.length + 2]; |
| 90 | + System.arraycopy(natures, 0, newNatures, 0, natures.length); |
| 91 | + newNatures[natures.length] = NodeNature.NATURE_ID; |
| 92 | + newNatures[natures.length+1] = JavaScriptCore.NATURE_ID; |
| 93 | + description.setNatureIds(newNatures); |
| 94 | + |
| 95 | + return description; |
| 96 | + } |
79 | 97 |
|
80 | 98 | protected void generateTemplates(String path, IProject projectHandle) throws CoreException {
|
81 | 99 | Bundle bundle = Activator.getDefault().getBundle();
|
|
0 commit comments