Search in sources :

Example 1 with Service

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);
    }
}
Also used : LinkServiceWizard(org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.LinkServiceWizard) Service(org.jboss.tools.openshift.core.odo.Service) IWizard(org.eclipse.jface.wizard.IWizard) Odo(org.jboss.tools.openshift.core.odo.Odo) IOException(java.io.IOException) LinkModel(org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.LinkModel)

Aggregations

IOException (java.io.IOException)1 IWizard (org.eclipse.jface.wizard.IWizard)1 Odo (org.jboss.tools.openshift.core.odo.Odo)1 Service (org.jboss.tools.openshift.core.odo.Service)1 LinkModel (org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.LinkModel)1 LinkServiceWizard (org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.LinkServiceWizard)1