throws CoreException {
IProject[] currentProjects = ResourcesPlugin.getWorkspace()
.getRoot().getProjects();
for (IProject current : currentProjects) {
if (!previousProjects.contains(current)) {
ConnectProviderOperation cpo = new ConnectProviderOperation(
current, myRepository.getDirectory());
cpo.execute(actMonitor);
}
}
}
};
try {
ResourcesPlugin.getWorkspace().run(wsr, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
break;
}
case GitSelectWizardPage.GENERAL_WIZARD: {
final String[] projectName = new String[1];
final boolean[] defaultLocation = new boolean[1];
// get the data from the page in the UI thread
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() {
projectName[0] = myCreateGeneralProjectPage
.getProjectName();
defaultLocation[0] = myCreateGeneralProjectPage
.isDefaultLocation();
}
});
try {
IWorkspaceRunnable wsr = new IWorkspaceRunnable() {
public void run(IProgressMonitor actMonitor)
throws CoreException {
final IProjectDescription desc = ResourcesPlugin
.getWorkspace().newProjectDescription(
projectName[0]);
if (!defaultLocation[0])
desc.setLocation(new Path(myGitDir));
IProject prj = ResourcesPlugin.getWorkspace().getRoot()
.getProject(desc.getName());
prj.create(desc, actMonitor);
prj.open(actMonitor);
ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
IResource.DEPTH_ONE, actMonitor);
File repoDir = myRepository.getDirectory();
ConnectProviderOperation cpo = new ConnectProviderOperation(
prj, repoDir);
cpo.execute(new NullProgressMonitor());
}
};
ResourcesPlugin.getWorkspace().run(wsr, monitor);
} catch (CoreException e) {