public static void showBalloonForComponent(@NotNull Component component, final @NotNull @NlsContexts.PopupContent String message, final MessageType type,
                                             final boolean atTop, final @Nullable Disposable disposable) {
    final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
    if (popupFactory == null) return;
    BalloonBuilder balloonBuilder = popupFactory.createHtmlTextBalloonBuilder(message, type, null);
    balloonBuilder.setDisposable(disposable == null ? ApplicationManager.getApplication() : disposable);
    Balloon balloon = balloonBuilder.createBalloon();
    Dimension size = component.getSize();
    Balloon.Position position;
    int x;
    int y;
    if (size == null) {
      x = y = 0;
      position = Balloon.Position.above;
    }
    else {
      x = Math.min(10, size.width / 2);
      y = size.height;
      position = Balloon.Position.below;
    }
    balloon.show(new RelativePoint(component, new Point(x, y)), position);
  }
public static void showBalloonForComponent(@NotNull Component component, final @NotNull @NlsContexts.PopupContent String message, final MessageType type,
                                             final boolean atTop, final @Nullable Disposable disposable)