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

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

Introduction

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

Prototype

@NotNull
    public Icon getDefaultIcon() 

Source Link

Usage

From source file:com.android.tools.idea.npw.importing.ModuleImportSettingsPane.java

License:Apache License

@Override
public void setValidationStatus(@Nullable MessageType type, @Nullable String message) {
    myStatusMessage.setText(ImportUIUtil.makeHtmlString(message));
    myStatusMessage.setIcon(type == null ? null : type.getDefaultIcon());
}

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  . java  2s.  c  o  m*/
public BalloonBuilder createHtmlTextBalloonBuilder(@NotNull String htmlContent, MessageType messageType,
        @Nullable HyperlinkListener listener) {
    return createHtmlTextBalloonBuilder(htmlContent, messageType.getDefaultIcon(),
            messageType.getPopupBackground(), listener);
}

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//from   www  .j a v a 2  s . 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);
}