Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » how to create an empty Eclipse project at runtime
how to create an empty Eclipse project at runtime [message #305796] Thu, 13 July 2006 04:29 Go to next message
Eclipse UserFriend
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
Re: how to create an empty Eclipse project at runtime [message #305799 is a reply to message #305796] Thu, 13 July 2006 06:16 Go to previous message
Eclipse UserFriend
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
>
>
Previous Topic:Coolbar contributions not shown
Next Topic:Running Infocenter as Windows service
Goto Forum:
  


Current Time: Wed Oct 15 04:22:42 EDT 2025

Powered by FUDForum. Page generated in 0.45161 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top