public void setViewportView(@NotNull DocumentationEditorPane editorPane,
                              @NotNull JLabel locationLabel) {
    JPanel panel = new JPanel(new BorderLayout()) {
      @Override
      public Dimension getPreferredSize() {
        JBViewport parent = (JBViewport)getParent();
        Dimension minimumSize = editorPane.getMinimumSize();
        Insets insets = getInsets();
        int insetWidth = insets.left + insets.right;
        int width = Math.max(Math.max(minimumSize.width, parent.getWidth() - insetWidth), scale(200));
        Dimension editorPaneSize = editorPane.getPackedSize(width, width);
        Dimension locationLabelSize = locationLabel.isVisible() ? locationLabel.getPreferredSize() : new Dimension();
        return new Dimension(width + insetWidth, editorPaneSize.height + locationLabelSize.height + insets.top + insets.bottom);
      }
    };
    panel.add(editorPane, BorderLayout.CENTER);
    panel.add(locationLabel, BorderLayout.SOUTH);
    panel.setOpaque(true);
    locationLabel.setOpaque(true);
    setViewportView(panel);
  }
public void setViewportView(@NotNull DocumentationEditorPane editorPane,
                              @NotNull JLabel locationLabel)