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);
}
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);
}
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);
}
});
}
Aggregations