Example usage for com.intellij.openapi.ui.popup BalloonBuilder setHideOnKeyOutside

List of usage examples for com.intellij.openapi.ui.popup BalloonBuilder setHideOnKeyOutside

Introduction

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

Prototype

@NotNull
    BalloonBuilder setHideOnKeyOutside(boolean hide);

Source Link

Usage

From source file:com.intellij.find.impl.livePreview.LivePreview.java

License:Apache License

private void showBalloon(Editor editor, String replacementPreviewText) {
    if (ApplicationManager.getApplication().isUnitTestMode()) {
        myReplacementPreviewText = replacementPreviewText;
        return;//  w  w w .  j a  v a2 s. co  m
    }

    ReplacementView replacementView = new ReplacementView(replacementPreviewText);

    BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(replacementView);
    balloonBuilder.setFadeoutTime(0);
    balloonBuilder.setFillColor(IdeTooltipManager.GRAPHITE_COLOR);
    balloonBuilder.setAnimationCycle(0);
    balloonBuilder.setHideOnClickOutside(false);
    balloonBuilder.setHideOnKeyOutside(false);
    balloonBuilder.setHideOnAction(false);
    balloonBuilder.setCloseButtonEnabled(true);
    myReplacementBalloon = balloonBuilder.createBalloon();

    myReplacementBalloon.show(new ReplacementBalloonPositionTracker(editor), Balloon.Position.above);
}

From source file:org.twodividedbyzero.idea.findbugs.gui.common.BalloonTipFactory.java

License:Open Source License

private static void _createBalloon(final Project project, final Component parent, final Orientation orientation,
        final BalloonBuilder builder) {
    builder.setHideOnClickOutside(true);
    builder.setHideOnKeyOutside(true);
    final Balloon balloon = builder.createBalloon();
    balloon.show(new RelativePoint(parent, new Point(parent.getWidth() / 2, parent.getHeight() / 2)),
            orientation.getOrientation());
}