package com.intellij.debugger.streams.ui;

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
import com.intellij.debugger.streams.trace.TracingResult;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.ui.components.JBLabel;
import com.intellij.util.ui.JBDimension;
import com.intellij.util.ui.components.BorderLayoutPanel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.Arrays;

/**
 * @author Vitaliy.Bibaev
 */
public class EvaluationAwareTraceWindow extends DialogWrapper {
  private static final JComponent EMPTY_CONTENT = new JBLabel("Evaluation in process", SwingConstants.CENTER);
  private static final JComponent FAIL_CONTENT = new JBLabel("Tracing failed", SwingConstants.CENTER);

  private final JPanel myCenterPane;

  public EvaluationAwareTraceWindow(@Nullable Project project) {
    super(project, false);
    setModal(false);
    setTitle("Stream Trace");
    myCenterPane = new BorderLayoutPanel();
    myCenterPane.add(EMPTY_CONTENT);
    myCenterPane.setPreferredSize(new JBDimension(100, 100));
    init();
  }

  @Nullable
  @Override
  protected String getDimensionServiceKey() {
    return "#com.intellij.debugger.streams.ui.EvaluationAwareTraceWindow";
  }

  public void setTrace(@NotNull TracingResult result, @NotNull EvaluationContextImpl context) {
    clear();
    myCenterPane.add(new JBLabel("Done!", SwingConstants.CENTER));
    myCenterPane.revalidate();
    myCenterPane.repaint();
  }

  public void setFailMessage() {
    clear();
    myCenterPane.add(FAIL_CONTENT);
  }

  private void clear() {
    Arrays.stream(myCenterPane.getComponents()).forEach(myCenterPane::remove);
  }

  @Nullable
  @Override
  protected JComponent createCenterPanel() {
    return myCenterPane;
  }
}

@@ -147,27 +147,86 @@
 ams.
-trace.TracingResult
+resolve.ResolvedCall;%0Aimport com.intellij.debugger.streams.wrapper.StreamChain
 ;%0Aim
@@ -381,54 +381,8 @@
 lij.
-util.ui.JBDimension;%0Aimport com.intellij.util.
 ui.c
@@ -391,28 +391,18 @@
 ponents.
+J
 B
-orderLayout
 Panel;%0Ai
@@ -508,16 +508,35 @@
 wing.*;%0A
+import java.awt.*;%0A
 import j
@@ -551,16 +551,39 @@
 .Arrays;
+%0Aimport java.util.List;
 %0A%0A/**%0A *
@@ -988,16 +988,44 @@
  project
+, @NotNull StreamChain chain
 ) %7B%0A    
@@ -1125,70 +1125,134 @@
 new 
-BorderLayoutPanel();%0A    myCenterPane.add(EMPTY_CONTENT);
+JBPanel(new GridLayout(1, chain.length()));%0A    for (int i = 0, chainLength = chain.length(); i %3C chainLength; i++) %7B
 %0A    
+  //
 myCe
@@ -1264,52 +1264,20 @@
 ane.
-setPreferredSize(new JBDimension(100, 100));
+add();%0A    %7D
 %0A   
@@ -1476,28 +1476,32 @@
 ull 
-TracingResult result
+List%3CResolvedCall%3E calls
 , @N

Change signatures of EvaluationAwareTraceWindow