Search in sources :

Example 1 with CreateURLModel

use of org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.CreateURLModel in project jbosstools-openshift by jbosstools.

the class CreateURLHandler 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();
        final CreateURLModel model = new CreateURLModel(odo, projectName, applicationName, component.getWrapped().getName());
        final IWizard createURLWizard = new CreateURLWizard(model);
        if (WizardUtils.openWizardDialog(createURLWizard, shell) == Window.OK) {
            executeInJob("Create url", monitor -> execute(model, component));
        }
        return Status.OK_STATUS;
    } catch (IOException e) {
        return OpenShiftUIActivator.statusFactory().errorStatus(e);
    }
}
Also used : IWizard(org.eclipse.jface.wizard.IWizard) Odo(org.jboss.tools.openshift.core.odo.Odo) CreateURLModel(org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.CreateURLModel) CreateURLWizard(org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.CreateURLWizard) IOException(java.io.IOException)

Aggregations

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