use of org.jboss.tools.openshift.core.odo.Service in project jbosstools-openshift by jbosstools.
the class LinkServiceHandler method execute.
@Override
public Object execute(ComponentElement component, Shell shell) throws ExecutionException {
try {
Odo odo = component.getRoot().getOdo();
String projectName = component.getParent().getParent().getWrapped();
String applicationName = component.getParent().getWrapped().getName();
List<Service> serviceNames = odo.getServices(projectName, applicationName);
final LinkModel<Service> model = new LinkModel<>(odo, projectName, applicationName, component.getWrapped().getName(), serviceNames);
final IWizard linkServiceWizard = new LinkServiceWizard(model);
if (WizardUtils.openWizardDialog(linkServiceWizard, shell) == Window.OK) {
executeInJob("Link service", monitor -> execute(shell, model, component));
}
return Status.OK_STATUS;
} catch (IOException e) {
return OpenShiftUIActivator.statusFactory().errorStatus(e);
}
}
Aggregations