Example usage for com.intellij.openapi.ui.popup JBPopupFactory createBalloonBuilder

List of usage examples for com.intellij.openapi.ui.popup JBPopupFactory createBalloonBuilder

Introduction

In this page you can find the example usage for com.intellij.openapi.ui.popup JBPopupFactory createBalloonBuilder.

Prototype

@NotNull
    public abstract BalloonBuilder createBalloonBuilder(@NotNull JComponent content);

Source Link

Usage

From source file:glslplugin.actions.GLSLDeduceExpressionTypeAction.java

License:Open Source License

private void showBalloon(AnActionEvent e, String html) {
    final Editor editor = e.getData(CommonDataKeys.EDITOR_EVEN_IF_INACTIVE);
    if (editor == null)
        return;//w  w w  . j a v  a 2 s . c  o m
    final JBPopupFactory factory = JBPopupFactory.getInstance();
    final BalloonBuilder builder = factory.createBalloonBuilder(new JLabel(html));
    Balloon balloon = builder.createBalloon();
    RelativePoint position = factory.guessBestPopupLocation(editor);
    balloon.show(position, Balloon.Position.below);
}