Search in sources :

Example 6 with TektonTreeStructure

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

the class TreeHelper method refresh.

public static void refresh(Project project, ParentableNode node) {
    TektonTreeStructure structure = (TektonTreeStructure) getTree(project).getClientProperty(Constants.STRUCTURE_PROPERTY);
    structure.fireModified(node);
}
Also used : TektonTreeStructure(com.redhat.devtools.intellij.tektoncd.tree.TektonTreeStructure)

Example 7 with TektonTreeStructure

use of com.redhat.devtools.intellij.tektoncd.tree.TektonTreeStructure 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 8 with TektonTreeStructure

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

the class StartLastRunAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent anActionEvent, TreePath path, Object selected, Tkn tkncli) {
    telemetry = TelemetryService.instance().action(NAME_PREFIX_START_STOP + "start last run");
    ExecHelper.submit(() -> {
        ParentableNode<? extends ParentableNode<NamespaceNode>> element = getElement(selected);
        String namespace = element.getParent().getParent().getName();
        try {
            String runName = startRun(tkncli, element, namespace);
            FollowLogsAction.run(namespace, runName, element.getClass(), tkncli);
            ((TektonTreeStructure) getTree(anActionEvent).getClientProperty(Constants.STRUCTURE_PROPERTY)).fireModified(element);
            telemetry.send();
        } catch (IOException e) {
            String errorMessage = element.getName() + " in namespace " + namespace + " failed to start\n" + e.getLocalizedMessage();
            telemetry.error(anonymizeResource(element.getName(), namespace, errorMessage)).send();
            Notification notification = new Notification(NOTIFICATION_ID, "Error", errorMessage, NotificationType.ERROR);
            Notifications.Bus.notify(notification);
            logger.warn("Error: " + e.getLocalizedMessage(), e);
        }
    });
}
Also used : TektonTreeStructure(com.redhat.devtools.intellij.tektoncd.tree.TektonTreeStructure) NamespaceNode(com.redhat.devtools.intellij.tektoncd.tree.NamespaceNode) IOException(java.io.IOException) Notification(com.intellij.notification.Notification)

Aggregations

TektonTreeStructure (com.redhat.devtools.intellij.tektoncd.tree.TektonTreeStructure)8 ParentableNode (com.redhat.devtools.intellij.tektoncd.tree.ParentableNode)3 IOException (java.io.IOException)3 Tree (com.intellij.ui.treeStructure.Tree)2 PipelineRunNode (com.redhat.devtools.intellij.tektoncd.tree.PipelineRunNode)2 TaskRunNode (com.redhat.devtools.intellij.tektoncd.tree.TaskRunNode)2 ActionMessage (com.redhat.devtools.intellij.telemetry.core.service.TelemetryMessageBuilder.ActionMessage)2 NodeRenderer (com.intellij.ide.util.treeView.NodeRenderer)1 Notification (com.intellij.notification.Notification)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 ActionManager (com.intellij.openapi.actionSystem.ActionManager)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 Messages (com.intellij.openapi.ui.Messages)1 OnePixelSplitter (com.intellij.ui.OnePixelSplitter)1 JBScrollPane (com.intellij.ui.components.JBScrollPane)1 ContentFactory (com.intellij.ui.content.ContentFactory)1 AsyncTreeModel (com.intellij.ui.tree.AsyncTreeModel)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