Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Programmatic Import of Project
Programmatic Import of Project [message #150492] Tue, 28 October 2003 20:40 Go to next message
Eclipse UserFriend
Is there an API in place for programmaticly importing a project?

Thanks
David Corbin
Re: Programmatic Import of Project [message #151639 is a reply to message #150492] Thu, 30 October 2003 14:28 Go to previous message
Eclipse UserFriend
Yes,

First, you have to make sure that the folder that you want to import as a
project exists in the file system.
Then, if the folder as a .project file in it, you can do the following:

IProjectDescription desc =
ResourcesPlugin.getWorkspace().loadProjectDescription(projec tPath);

Otherwise, you can do this:

IProjectDescription desc =
ResourcesPlugin.getWorkspace().newProjectDescription(project Name);
desc.setLocation(projectPath);

Then, you want to use a sublclass of WorkspaceModifyOperation to create the
project:

class CreateProjectOperation extends WorkspaceModifyOperation {

protected void execute(IProgressMonitor monitor) throws CoreException {
IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject(projectN ame);
project.create(desc, monitor);
}
}



"David Corbin" <dcorbin@ieee.org> wrote in message
news:bnn5o9$m91$1@eclipse.org...
> Is there an API in place for programmaticly importing a project?
>
> Thanks
> David Corbin
Previous Topic:Where is Update Manager/External Preview in Eclipse R3 M4?
Next Topic:Showing a view programitically?
Goto Forum:
  


Current Time: Wed Sep 17 03:31:15 EDT 2025

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

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

Back to the top