Search in sources :

Example 11 with ParentableNode

use of com.redhat.devtools.intellij.tektoncd.tree.ParentableNode in project intellij-tekton by redhat-developer.

the class StartAction method refreshTreeNode.

private void refreshTreeNode(AnActionEvent anActionEvent, ParentableNode element) {
    ParentableNode nodeToRefresh = element;
    if (element instanceof PipelineRunNode || element instanceof TaskRunNode) {
        nodeToRefresh = (ParentableNode) element.getParent();
    }
    ((TektonTreeStructure) getTree(anActionEvent).getClientProperty(Constants.STRUCTURE_PROPERTY)).fireModified(nodeToRefresh);
}
Also used : ParentableNode(com.redhat.devtools.intellij.tektoncd.tree.ParentableNode) TektonTreeStructure(com.redhat.devtools.intellij.tektoncd.tree.TektonTreeStructure) TaskRunNode(com.redhat.devtools.intellij.tektoncd.tree.TaskRunNode) PipelineRunNode(com.redhat.devtools.intellij.tektoncd.tree.PipelineRunNode)

Example 12 with ParentableNode

use of com.redhat.devtools.intellij.tektoncd.tree.ParentableNode in project intellij-tekton by redhat-developer.

the class TektonHubAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent anActionEvent, TreePath path, Object selected, Tkn tkncli) {
    ActionMessage telemetry = TelemetryService.instance().action(NAME_PREFIX_CRUD + "tekton hub");
    ExecHelper.submit(() -> {
        ParentableNode element = getElement(selected);
        Project project = getEventProject(anActionEvent);
        HubModel model = new HubModel(project, tkncli, element);
        telemetry.send();
        UIHelper.executeInUI(() -> {
            HubDialog wizard = new HubDialog(project, model);
            wizard.setModal(false);
            wizard.show();
            return wizard;
        });
    });
}
Also used : Project(com.intellij.openapi.project.Project) ParentableNode(com.redhat.devtools.intellij.tektoncd.tree.ParentableNode) HubDialog(com.redhat.devtools.intellij.tektoncd.ui.hub.HubDialog) ActionMessage(com.redhat.devtools.intellij.telemetry.core.service.TelemetryMessageBuilder.ActionMessage) HubModel(com.redhat.devtools.intellij.tektoncd.ui.hub.HubModel)

Example 13 with ParentableNode

use of com.redhat.devtools.intellij.tektoncd.tree.ParentableNode in project intellij-tekton by redhat-developer.

the class FindClusterTaskRefAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent anActionEvent, TreePath path, Object selected, Tkn tkncli) {
    ParentableNode element = getElement(selected);
    ExecHelper.submit(() -> {
        try {
            List<RefUsage> usages = tkncli.findTaskUsages(KIND_CLUSTERTASK, element.getName());
            UIHelper.executeInUI(() -> FindTaskRefPanelBuilder.instance().build(anActionEvent.getProject(), KIND_CLUSTERTASK, element.getName(), usages));
        } catch (IOException e) {
            logger.warn(e.getLocalizedMessage(), e);
        }
    });
}
Also used : ParentableNode(com.redhat.devtools.intellij.tektoncd.tree.ParentableNode) RefUsage(com.redhat.devtools.intellij.tektoncd.ui.toolwindow.findusage.RefUsage) IOException(java.io.IOException)

Aggregations

ParentableNode (com.redhat.devtools.intellij.tektoncd.tree.ParentableNode)13 IOException (java.io.IOException)8 ActionMessage (com.redhat.devtools.intellij.telemetry.core.service.TelemetryMessageBuilder.ActionMessage)6 Notification (com.intellij.notification.Notification)4 PipelineRunNode (com.redhat.devtools.intellij.tektoncd.tree.PipelineRunNode)4 TaskRunNode (com.redhat.devtools.intellij.tektoncd.tree.TaskRunNode)4 TektonTreeStructure (com.redhat.devtools.intellij.tektoncd.tree.TektonTreeStructure)3 RefUsage (com.redhat.devtools.intellij.tektoncd.ui.toolwindow.findusage.RefUsage)3 Project (com.intellij.openapi.project.Project)2 PipelineNode (com.redhat.devtools.intellij.tektoncd.tree.PipelineNode)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 YAMLMapper (com.fasterxml.jackson.dataformat.yaml.YAMLMapper)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 Messages (com.intellij.openapi.ui.Messages)1 Tree (com.intellij.ui.treeStructure.Tree)1 ExecHelper (com.redhat.devtools.intellij.common.utils.ExecHelper)1 UIHelper (com.redhat.devtools.intellij.common.utils.UIHelper)1 Constants (com.redhat.devtools.intellij.tektoncd.Constants)1 KIND_CLUSTERTASK (com.redhat.devtools.intellij.tektoncd.Constants.KIND_CLUSTERTASK)1 KIND_TASK (com.redhat.devtools.intellij.tektoncd.Constants.KIND_TASK)1