PY-19960 PY-14096 Merge right-click menu creation for toggle output and split/merge...
[idea/community.git] / python / ipnb / src / org / jetbrains / plugins / ipnb / editor / panels / code / IpnbStreamPanel.java
1 package org.jetbrains.plugins.ipnb.editor.panels.code;
2
3 import com.intellij.openapi.ui.MessageType;
4 import org.jetbrains.annotations.NotNull;
5 import org.jetbrains.annotations.Nullable;
6 import org.jetbrains.plugins.ipnb.format.cells.output.IpnbStreamOutputCell;
7
8 import javax.swing.*;
9
10 public class IpnbStreamPanel extends IpnbCodeOutputPanel<IpnbStreamOutputCell> {
11   public IpnbStreamPanel(@NotNull final IpnbStreamOutputCell cell, @Nullable IpnbCodePanel ipnbCodePanel) {
12     super(cell, null, ipnbCodePanel);
13   }
14
15   @Override
16   protected JComponent createViewPanel() {
17     final JComponent viewPanel = super.createViewPanel();
18     if ("stderr".equals(myCell.getStream())) {
19       viewPanel.setBackground(MessageType.ERROR.getPopupBackground());
20     }
21     return viewPanel;
22   }
23 }