package org.jetbrains.plugins.ipnb.editor.panels.code;

import com.intellij.openapi.editor.colors.EditorColorsManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.ipnb.editor.IpnbEditorUtil;
import org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel;
import org.jetbrains.plugins.ipnb.editor.panels.IpnbPanel;
import org.jetbrains.plugins.ipnb.format.cells.output.IpnbOutputCell;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;

public class IpnbCodeOutputPanel<K extends IpnbOutputCell> extends IpnbPanel<JComponent, K> {
  protected final IpnbFilePanel myParent;

  public IpnbCodeOutputPanel(@NotNull final K cell, @Nullable final IpnbFilePanel parent, @NotNull final MouseAdapter hideOutputAdapter) {
    super(cell, new BorderLayout());
    myParent = parent;
    myViewPanel = createViewPanel();
    add(myViewPanel);
    addHideOutputListener(hideOutputAdapter);
  }

  protected JComponent createViewPanel() {
    JTextArea textArea = new JTextArea(myCell.getSourceAsString());
    textArea.setLineWrap(true);
    textArea.setEditable(false);
    final Font font = textArea.getFont();
    final Font newFont = new Font(font.getName(), font.getStyle(), EditorColorsManager.getInstance().getGlobalScheme().getEditorFontSize());
    textArea.setFont(newFont);
    textArea.setBackground(IpnbEditorUtil.getBackground());
    return textArea;
  }
  
  public void addHideOutputListener(@NotNull final MouseAdapter mouseAdapter) {
    myViewPanel.addMouseListener(mouseAdapter);
  }
}

@@ -515,21 +515,22 @@
 nt.Mouse
-Adapt
+Listen
 er;%0A%0Apub
@@ -755,22 +755,23 @@
 rent, @N
-otN
 ull
+able
  final M
@@ -774,21 +774,22 @@
 al Mouse
-Adapt
+Listen
 er hideO
@@ -1490,22 +1490,23 @@
 tener(@N
-otN
 ull
+able
  final M
@@ -1509,21 +1509,22 @@
 al Mouse
-Adapt
+Listen
 er mouse

Fix PY-14096 Minor Make mouse listener nullable