public static @NotNull JEditorPane createHtmlViewer(boolean lineWrap,
                                                      @Nullable Font font,
                                                      @Nullable Color background,
                                                      @Nullable Color foreground) {
    final JEditorPane textPane;
    if (lineWrap) {
      textPane = new JEditorPane() {
        @Override
        public Dimension getPreferredSize() {
          // This trick makes text component to carry text over to the next line
          // if the text line width exceeds parent's width
          Dimension dimension = super.getPreferredSize();
          dimension.width = 0;
          return dimension;
        }
      };
    }
    else {
      textPane = new JEditorPane();
    }
    GraphicsUtil.setAntialiasingType(textPane, AntialiasingType.getAAHintForSwingComponent());
    textPane.setFont(font != null ? font : StartupUiUtil.getLabelFont());
    textPane.setEditorKit(HTMLEditorKitBuilder.simple());
    textPane.setEditable(false);
    if (background != null) {
      textPane.setBackground(background);
    }
    else {
      NonOpaquePanel.setTransparent(textPane);
    }
    textPane.setForeground(foreground != null ? foreground : UIUtil.getLabelForeground());
    textPane.setFocusable(false);
    return textPane;
  }
public static @NotNull JEditorPane createHtmlViewer(boolean lineWrap,
                                                      @Nullable Font font,
                                                      @Nullable Color background,
                                                      @Nullable Color foreground)