@NotNull
  public static JComponent createTitle(@Nullable @NlsContexts.Label String title,
                                       @Nullable LineSeparator separator,
                                       @Nullable Charset charset,
                                       @Nullable Boolean bom,
                                       boolean readOnly,
                                       @Nullable DiffEditorTitleCustomizer titleCustomizer) {
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(JBUI.Borders.empty(0, 4));
    BorderLayoutPanel labelWithIcon = new BorderLayoutPanel();
    JComponent titleLabel = titleCustomizer != null ? titleCustomizer.getLabel()
                                                    : new JBLabel(StringUtil.notNullize(title)).setCopyable(true);
    labelWithIcon.addToCenter(titleLabel);
    if (readOnly) {
      labelWithIcon.addToLeft(new JBLabel(AllIcons.Ide.Readonly));
    }
    panel.add(labelWithIcon, BorderLayout.CENTER);
    if (charset != null || separator != null) {
      JPanel panel2 = new JPanel();
      panel2.setLayout(new BoxLayout(panel2, BoxLayout.X_AXIS));
      if (charset != null) {
        panel2.add(Box.createRigidArea(JBUI.size(4, 0)));
        panel2.add(createCharsetPanel(charset, bom));
      }
      if (separator != null) {
        panel2.add(Box.createRigidArea(JBUI.size(4, 0)));
        panel2.add(createSeparatorPanel(separator));
      }
      panel.add(panel2, BorderLayout.EAST);
    }
    return panel;
  }
@NotNull
  public static JComponent createTitle(@Nullable @NlsContexts.Label String title,
                                       @Nullable LineSeparator separator,
                                       @Nullable Charset charset,
                                       @Nullable Boolean bom,
                                       boolean readOnly,
                                       @Nullable DiffEditorTitleCustomizer titleCustomizer)