[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.jdt] Re: Create a project via the JDT API
|
Yes, you can do it by create a org.eclipse.core.resources.IProject and
add the Java Nature to that project.
IProject project = ResourcesPlugin.getWorkspace().getRoot().
getProject("NewProjectName");
project.create(null);
project.open(null);
IProjectDescription description = project.getDescription();
String[] ids = description.getNatureIds();
String[] newIds = new String[ids.length+1];
System.arraycopy(ids, 0, newIds, 0, ids.length);
newIds[newIds.length-1] = JavaCore.NATURE_ID;
description.setNatureIds(newIds);
project.setDescription(description, null);
Christian Nill wrote:
Hello,
Is it possible to create a new project in Eclipse 3.1.1 using the JDT
API? So far I have only found functions in that API which allow me to
open existing projects ( like JavaCore.create(IProject) ) and the
JavaCapabilityConfigurationPage wizard. I would like to create an entire
new project automatically. Is that feasible?
Thank you,
Christian