void (@Nullable JComponent header) { // ReadAction? JComponent oldComponent = getHeaderComponent(); myHeaderPanel.removeAll(); JComponent permanentHeader = getPermanentHeaderComponent(); if (header == null) { header = permanentHeader; } else if (permanentHeader != null && header != permanentHeader) { JPanel headerPanel = new JPanel(new BorderLayout()); headerPanel.add(permanentHeader, BorderLayout.NORTH); headerPanel.add(header, BorderLayout.SOUTH); header = headerPanel; } if (header != null) { myHeaderPanel.add(header); myPropertyChangeSupport.firePropertyChange(PROP_HEADER_COMPONENT, oldComponent, header); } myHeaderPanel.revalidate(); myHeaderPanel.repaint(); if (SystemInfo.isMac) { TouchbarSupport.onUpdateEditorHeader(this); } }