public void selectionChanged(SelectionChangedEvent event) {
Object[] services = servicesViewer.getCheckedElements();
if (services != null) {
selectedServicesToBind.clear();
for (Object obj : services) {
CloudService service = (CloudService) obj;
selectedServicesToBind.add(service.getName());
}
setServicesToBindInDescriptor();
}
}
});
Action addServiceAction = new Action(Messages.COMMONTXT_ADD_SERVICE, CloudFoundryImages.NEW_SERVICE) {
public void run() {
// Do not create the service right away.
boolean deferAdditionOfService = true;
CloudFoundryServiceWizard wizard = new CloudFoundryServiceWizard(cloudServer, deferAdditionOfService);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.setBlockOnOpen(true);
if (dialog.open() == Window.OK) {
// This cloud service does not yet exist. It will be created
// outside of the wizard
CloudService addedService = wizard.getService();
if (addedService != null) {
addService(addedService);
}
}
}