|
Re: Programmatic Import of Project [message #151639 is a reply to message #150492] |
Thu, 30 October 2003 14:28  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.06106 seconds