protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException,
InterruptedException {
monitor.beginTask("Creating Roo project: ", 6);
monitor.subTask("loading Spring Roo");
IRooInstall install = (useDefault ? RooCoreActivator.getDefault().getInstallManager()
.getDefaultRooInstall() : RooCoreActivator.getDefault().getInstallManager().getRooInstall(
rooInstall));
monitor.worked(1);
Bootstrap bootstrap = null;
try {
// Create project location
monitor.subTask("creating project location");
File projectFile = new File(new File(location), projectPage.getProjectName());
if (!projectFile.exists()) {
projectFile.mkdirs();
}
monitor.worked(2);
monitor.subTask("starting Spring Roo shell");
String javaVersion = JavaCore.getOption("org.eclipse.jdt.core.compiler.compliance");
String rooJavaVersion = (ROO_JAVA_VERSION_MAPPING.containsKey(javaVersion) ? ROO_JAVA_VERSION_MAPPING
.get(javaVersion)
: "6");
// Create Roo project by launching Roo and invoking the
// create project command
String projectLocation = projectFile.getCanonicalPath();
bootstrap = new Bootstrap(projectLocation, install.getHome(), install.getVersion(), new ProjectRefresher(null));
// Init Roo shell
bootstrap.start(new StyledTextAppender(shellPage.getRooShell()), projectPage.getProjectName());
monitor.worked(3);