Example usage for com.intellij.openapi.ui MessageType getPopupBackground

List of usage examples for com.intellij.openapi.ui MessageType getPopupBackground

Introduction

In this page you can find the example usage for com.intellij.openapi.ui MessageType getPopupBackground.

Prototype

@NotNull
    public Color getPopupBackground() 

Source Link

Usage

From source file:com.intellij.application.options.codeStyle.ManageCodeStyleSchemesDialog.java

License:Apache License

private static void showStatus(final Component component, final String message, MessageType messageType) {
    BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(message,
            messageType.getDefaultIcon(), messageType.getPopupBackground(), null);
    balloonBuilder.setFadeoutTime(5000);
    final Balloon balloon = balloonBuilder.createBalloon();
    final Rectangle rect = component.getBounds();
    final Point p = new Point(rect.x, rect.y + rect.height);
    final RelativePoint point = new RelativePoint(component, p);
    balloon.show(point, Balloon.Position.below);
    Disposer.register(ProjectManager.getInstance().getDefaultProject(), balloon);
}

From source file:com.intellij.ui.popup.PopupFactoryImpl.java

License:Apache License

@NotNull
@Override// w w w  .  j  a va 2  s. com
public BalloonBuilder createHtmlTextBalloonBuilder(@NotNull String htmlContent, MessageType messageType,
        @Nullable HyperlinkListener listener) {
    return createHtmlTextBalloonBuilder(htmlContent, messageType.getDefaultIcon(),
            messageType.getPopupBackground(), listener);
}

From source file:org.codinjutsu.tools.mongo.view.MongoResultPanel.java

License:Apache License

private void showNotification(final MessageType info, final String message) {
    GuiUtils.runInSwingThread(new Runnable() {
        @Override//from   ww  w. jav  a2 s  .  c  om
        public void run() {
            JBPopupFactory.getInstance().createBalloonBuilder(new JLabel(message))
                    .setFillColor(info.getPopupBackground()).createBalloon()
                    .show(new RelativePoint(MongoResultPanel.this.resultTreePanel, new Point(0, 0)),
                            Balloon.Position.above);
        }
    });
}

From source file:org.codinjutsu.tools.nosql.commons.utils.GuiUtils.java

License:Apache License

public static void showNotification(final JComponent component, final MessageType info, final String message,
        final Balloon.Position position) {
    runInSwingThread(new Runnable() {
        @Override//  ww w  .j a v a 2  s  .c o m
        public void run() {
            JBPopupFactory.getInstance().createBalloonBuilder(new JLabel(message))
                    .setFillColor(info.getPopupBackground()).createBalloon()
                    .show(new RelativePoint(component, new Point(0, 0)), position);
        }
    });
}

From source file:org.jetbrains.plugins.groovy.actions.GrGetPsiTypeAction.java

License:Apache License

/**
 * Shows an information balloon in a reasonable place at the top right of the window.
 *
 * @param project     our project/*w w  w  .  j  a v a2s .c  om*/
 * @param message     the text, HTML markup allowed
 * @param messageType message type, changes the icon and the background.
 */
// TODO: move to a better place
public static void showBalloon(Project project, String message, MessageType messageType) {
    // ripped from com.intellij.openapi.vcs.changes.ui.ChangesViewBalloonProblemNotifier
    final JFrame frame = WindowManager.getInstance().getFrame(project.isDefault() ? null : project);
    if (frame == null)
        return;
    final JComponent component = frame.getRootPane();
    if (component == null)
        return;
    final Rectangle rect = component.getVisibleRect();
    final Point p = new Point(rect.x + rect.width - 10, rect.y + 10);
    final RelativePoint point = new RelativePoint(component, p);

    JBPopupFactory.getInstance()
            .createHtmlTextBalloonBuilder(message, messageType.getDefaultIcon(),
                    messageType.getPopupBackground(), null)
            .setShowCallout(false).setCloseButtonEnabled(true).createBalloon()
            .show(point, Balloon.Position.atLeft);
}

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

License:Open Source License

public static void showInfoPopup(final Project project, final Component parent, final String html,
        final Orientation orientation) {
    final MessageType type = MessageType.INFO;
    final BalloonBuilder builder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(html,
            type.getDefaultIcon(), type.getPopupBackground(), null);
    _createBalloon(project, parent, orientation, builder);
}

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

License:Open Source License

public static void showWarnPopup(final Project project, final Component parent, final String html,
        final Orientation orientation) {
    final MessageType type = MessageType.WARNING;
    final BalloonBuilder builder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(html,
            type.getDefaultIcon(), type.getPopupBackground(), null);
    _createBalloon(project, parent, orientation, builder);
}

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

License:Open Source License

public static void showErrorPopup(final Project project, final Component parent, final String html,
        final Orientation orientation) {
    final MessageType type = MessageType.ERROR;
    final BalloonBuilder builder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(html,
            type.getDefaultIcon(), type.getPopupBackground(), null);
    _createBalloon(project, parent, orientation, builder);
}