use of org.jboss.tools.openshift.internal.ui.dialog.ResourceSummaryDialog in project jbosstools-openshift by jbosstools.
the class NewResourceWizard method performFinish.
@Override
public boolean performFinish() {
boolean success = false;
try (InputStream is = (OpenshiftUIConstants.URL_VALIDATOR.isValid(model.getSource())) ? new URL(model.getSource()).openStream() : new FileInputStream(VariablesHelper.replaceVariables(model.getSource()))) {
final CreateResourceJob createJob = new CreateResourceJob(model.getProject(), is);
createJob.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
IStatus status = event.getResult();
if (JobUtils.isOk(status) || JobUtils.isWarning(status)) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
new ResourceSummaryDialog(getShell(), createJob.getResource(), "Create Resource Summary", "Results of creating the resource(s)").open();
}
});
OpenShiftUIUtils.showOpenShiftExplorer();
}
}
});
IStatus status = runInWizard(createJob, createJob.getDelegatingProgressMonitor(), getContainer());
success = isSuccess(status);
} catch (InvocationTargetException | InterruptedException | IOException e) {
page.setErrorMessage(e.getClass().getName() + ": " + e.getLocalizedMessage());
success = false;
}
return success;
}
use of org.jboss.tools.openshift.internal.ui.dialog.ResourceSummaryDialog in project jbosstools-openshift by jbosstools.
the class DeployImageWizard method getDeployImageJob.
private static DeployImageJob getDeployImageJob(final IDeployImageParameters model, final Shell shell) {
final DeployImageJob deployJob = new DeployImageJob(model);
deployJob.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
IStatus status = event.getResult();
if ((JobUtils.isOk(status) || JobUtils.isWarning(status)) && !deployJob.getResources().isEmpty()) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
new ResourceSummaryDialog(shell, deployJob.getResources(), TITLE, deployJob.getSummaryMessage()).open();
}
});
OpenShiftUIUtils.showOpenShiftExplorer();
}
}
});
return deployJob;
}
use of org.jboss.tools.openshift.internal.ui.dialog.ResourceSummaryDialog in project jbosstools-openshift by jbosstools.
the class CreateApplicationFromImageJob method getSummaryRunnable.
@Override
public Runnable getSummaryRunnable(final Shell shell) {
return new Runnable() {
@Override
public void run() {
String message = NLS.bind("Results of creating the resources from the {0}/{1} builder image.", buildConfigModel.getBuilderImageNamespace(), buildConfigModel.getBuilderImageName());
new ResourceSummaryDialog(shell, getResources(), "Create Application Summary", message).open();
}
};
}
use of org.jboss.tools.openshift.internal.ui.dialog.ResourceSummaryDialog in project jbosstools-openshift by jbosstools.
the class ApplicationSourceListPage method onDefinedResourcesClicked.
private SelectionAdapter onDefinedResourcesClicked() {
return new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ITemplate template = (ITemplate) model.getSelectedAppSource().getSource();
new ResourceSummaryDialog(getShell(), template.getObjects(), "Template Details", NLS.bind("The following resources will be created by using template\n\"{0}\":", template.getName()), new ResourceDetailsLabelProvider(template.getParameters()), new ResourceDetailsContentProvider()).open();
}
};
}
Aggregations