use of org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.CreateComponentWizard in project jbosstools-openshift by jbosstools.
the class CreateComponentHandler method openDialog.
private static void openDialog(DevfileRegistryComponentTypeElement componentType, ApplicationElement application, ProjectElement project, final Shell parent) throws IOException {
Odo odo = project != null ? project.getParent().getOdo() : componentType.getRoot().getOdo();
String projectName = project != null ? project.getWrapped() : odo.getNamespace();
IProject eclipseProject = getOpenedProject();
final CreateComponentModel model = new CreateComponentModel(odo, odo.getComponentTypes(), projectName, application == null ? null : application.getWrapped().getName(), eclipseProject);
if (componentType != null) {
model.setSelectedComponentType(componentType.getWrapped());
}
final IWizard createComponentWizard = new CreateComponentWizard(model);
if (WizardUtils.openWizardDialog(createComponentWizard, parent) == Window.OK) {
AbstractOpenshiftUIElement<?, ?, ApplicationExplorerUIModel> element = componentType != null ? componentType.getRoot() : application == null ? project : application;
executeInJob("Creating component", monitor -> execute(parent, model, element));
}
}
Aggregations