|
Re: how to create an empty Eclipse project at runtime [message #305799 is a reply to message #305796] |
Thu, 13 July 2006 06:16  |
Eclipse User |
|
|
|
You will need the resources plugin (org.eclipse.core.resources):
IWorspace worspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
IProject project = root.getProject("MyNewProject");
if (!project.exists()) {
project.create(null);
}
if (!project.isOpen()) {
project.open(null);
}
Obviously the last two checks might not be necessary depending of the context.
The parameter for create() and open() is an optional IProgressMonitor.
You might want to take a look at this section in Eclipse documentation:
"Resources overview" under Platform Plug-in Developer Guide\Programmer's Guide
Barthelemy
Eswar wrote:
> Hi All,
>
> I have a scenario where I have to create an empty eclipse project from
> the code.
>
> Any ideas on how to proceed??
>
> Regards,
> Eswar
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03700 seconds