Search in sources :

Example 1 with StartWizard

use of com.redhat.devtools.intellij.tektoncd.ui.wizard.StartWizard in project intellij-tekton by redhat-developer.

the class StartAction method canBeStarted.

protected boolean canBeStarted(Project project, ParentableNode element, StartResourceModel model) {
    boolean hasNoInputs = model.getParams().isEmpty() && model.getInputResources().isEmpty() && model.getOutputResources().isEmpty() && model.getWorkspaces().isEmpty();
    boolean showWizard = SettingsState.getInstance().showStartWizardWithNoInputs || !hasNoInputs;
    if (showWizard) {
        StartWizard startWizard = UIHelper.executeInUI(() -> {
            String titleDialog = ((element instanceof PipelineNode) ? "Pipeline " : "Task ") + element.getName();
            StartWizard wizard = new StartWizard(titleDialog, element, project, model);
            wizard.show();
            return wizard;
        });
        if (startWizard != null && !startWizard.isOK()) {
            telemetry.result(VALUE_ABORTED).send();
            return false;
        }
    }
    return true;
}
Also used : StartWizard(com.redhat.devtools.intellij.tektoncd.ui.wizard.StartWizard) PipelineNode(com.redhat.devtools.intellij.tektoncd.tree.PipelineNode)

Aggregations

PipelineNode (com.redhat.devtools.intellij.tektoncd.tree.PipelineNode)1 StartWizard (com.redhat.devtools.intellij.tektoncd.ui.wizard.StartWizard)1