@Override
  public void setProcessesData(@NotNull ProcessTreeNode root) {
    processTree.asWidget().setVisible(true);
    processTree.getModel().setRoot(root);
    processTree.renderTree(-1);

    for (ProcessTreeNode processTreeNode : processTreeNodes.values()) {
      if (!processTreeNode.getId().equals(activeProcessId) && processTreeNode.hasUnreadContent()) {
        processTreeNode
            .getTreeNodeElement()
            .getClassList()
            .add(machineResources.getCss().badgeVisible());
      }
    }
  }
  @Override
  public void selectNode(final ProcessTreeNode node) {
    SelectionModel<ProcessTreeNode> selectionModel = processTree.getSelectionModel();

    if (node == null) {
      selectionModel.clearSelections();
      return;
    } else {
      selectionModel.setTreeActive(true);
      selectionModel.clearSelections();
      selectionModel.selectSingleNode(node);

      node.getTreeNodeElement().scrollIntoView();
    }

    Scheduler.get()
        .scheduleDeferred(
            new Scheduler.ScheduledCommand() {
              @Override
              public void execute() {
                delegate.onTreeNodeSelected(node);
              }
            });
  }
  @Inject
  public ConsolesPanelViewImpl(
      org.eclipse.che.ide.Resources resources,
      MachineResources machineResources,
      PartStackUIResources partStackUIResources,
      ProcessesViewImplUiBinder uiBinder,
      ProcessTreeRenderer renderer,
      ProcessDataAdapter adapter) {
    super(partStackUIResources);

    this.machineResources = machineResources;
    this.processWidgets = new HashMap<>();
    processTreeNodes = new LinkedHashMap<>();
    splitLayoutPanel = new SplitLayoutPanel(1);

    renderer.setAddTerminalClickHandler(
        new AddTerminalClickHandler() {
          @Override
          public void onAddTerminalClick(@NotNull String machineId) {
            delegate.onAddTerminal(machineId);
          }
        });

    renderer.setPreviewSshClickHandler(
        new PreviewSshClickHandler() {
          @Override
          public void onPreviewSshClick(@NotNull String machineId) {
            delegate.onPreviewSsh(machineId);
          }
        });

    renderer.setStopProcessHandler(
        new StopProcessHandler() {
          @Override
          public void onStopProcessClick(@NotNull ProcessTreeNode node) {
            delegate.onStopCommandProcess(node);
          }

          @Override
          public void onCloseProcessOutputClick(@NotNull ProcessTreeNode node) {
            ProcessTreeNode.ProcessNodeType type = node.getType();
            switch (type) {
              case COMMAND_NODE:
                delegate.onCloseCommandOutputClick(node);
                break;
              case TERMINAL_NODE:
                delegate.onCloseTerminal(node);
                break;
            }
          }
        });

    processTree = Tree.create(resources, adapter, renderer);
    processTree.asWidget().addStyleName(this.machineResources.getCss().processTree());

    processTree.setTreeEventHandler(
        new Tree.Listener<ProcessTreeNode>() {
          @Override
          public void onNodeAction(TreeNodeElement<ProcessTreeNode> node) {}

          @Override
          public void onNodeClosed(TreeNodeElement<ProcessTreeNode> node) {}

          @Override
          public void onNodeContextMenu(
              int mouseX, int mouseY, TreeNodeElement<ProcessTreeNode> node) {}

          @Override
          public void onNodeDragStart(TreeNodeElement<ProcessTreeNode> node, MouseEvent event) {}

          @Override
          public void onNodeDragDrop(TreeNodeElement<ProcessTreeNode> node, MouseEvent event) {}

          @Override
          public void onNodeExpanded(TreeNodeElement<ProcessTreeNode> node) {}

          @Override
          public void onNodeSelected(TreeNodeElement<ProcessTreeNode> node, SignalEvent event) {
            delegate.onTreeNodeSelected(node.getData());
          }

          @Override
          public void onRootContextMenu(int mouseX, int mouseY) {}

          @Override
          public void onRootDragDrop(MouseEvent event) {}

          @Override
          public void onKeyboard(KeyboardEvent event) {}
        });

    setContentWidget(uiBinder.createAndBindUi(this));
    navigationPanel.getElement().setTabIndex(0);
    minimizeButton.ensureDebugId("consoles-minimizeButton");

    tuneSplitter();
  }