return null;
}
@Override
public IStatus configure(IProgressMonitor monitor) {
RooInstallManager installManager = RooCoreActivator.getDefault().getInstallManager();
try {
String path = location.getCanonicalPath();
// Check existing installs if path is already configured
if (getRooInstall() != null) {
return new Status(IStatus.INFO, RooCoreActivator.PLUGIN_ID, NLS.bind("Roo runtime already configured at {0}", path));
}
// Save the old install path for later
oldDefaultPath = (installManager.getDefaultRooInstall() != null ? installManager.getDefaultRooInstall()
.getHome() : null);
/*
* Generate the name for new install
* spring-roo-1.0.2.RELEASE -> Roo 1.0.2.RELEASE
* roo-1.0.2.RELASE -> Roo 1.0.2.RELEASE
* spring-roo-1.0.2.BUILD-201005061233 -> Roo 1.0.2.BUILD-201005061233
* roo-1.0.2.BUILD-201005061233 -> Roo 1.0.2.BUILD-201005061233
*/
String name = getName(location.getName());
// Create a new install and make it default
IRooInstall newInstall = new DefaultRooInstall(path, name, true);
// Set installs
Set<IRooInstall> installs = new HashSet<IRooInstall>();
installs.add(newInstall);
for (IRooInstall install : installManager.getAllInstalls()) {
installs.add(new DefaultRooInstall(install.getHome(), install.getName(), false));
}
installManager.setRooInstalls(installs);
setConfigured(true);
return new Status(IStatus.OK, RooCoreActivator.PLUGIN_ID, NLS.bind("Roo runtime successfully configured at {0}", location));
}
catch (IOException e) {