final DeploymentInfoWorkingCopy finWorkingCopy = workingCopy;
final DeploymentConfiguration[] configuration = new DeploymentConfiguration[1];
Display.getDefault().syncExec(new Runnable() {
public void run() {
CloudFoundryApplicationWizard wizard = new CloudFoundryApplicationWizard(server, appModule,
finWorkingCopy, providerDelegate);
try {
// Update the lookup
ApplicationUrlLookupService.update(server, monitor);
WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getModalDialogShellProvider()
.getShell(), wizard);
int dialogueStatus = dialog.open();
if (dialogueStatus == Dialog.OK) {
// First add any new services to the server
final List<CloudService> addedServices = wizard.getCloudServicesToCreate();
writeToManifest[0] = wizard.persistManifestChanges();
configuration[0] = wizard.getDeploymentConfiguration();
if (addedServices != null && !addedServices.isEmpty()) {
IProgressMonitor subMonitor = new SubProgressMonitor(monitor, addedServices.size());
try {
server.getBehaviour().createService(addedServices.toArray(new CloudService[0]),