use of com.intellij.openapi.ui.popup.BalloonBuilder in project intellij-community by JetBrains.
the class IpnbConnectionManager method showWarning.
private static void showWarning(@NotNull final IpnbFileEditor fileEditor, @NotNull final String message, @Nullable final HyperlinkAdapter listener) {
ApplicationManager.getApplication().invokeLater(() -> {
BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(message, null, MessageType.WARNING.getPopupBackground(), listener);
final Balloon balloon = balloonBuilder.createBalloon();
ApplicationManager.getApplication().invokeLater(() -> balloon.showInCenterOf(fileEditor.getRunCellButton()));
});
}
use of com.intellij.openapi.ui.popup.BalloonBuilder in project intellij-community by JetBrains.
the class StudyRefreshTaskFileAction method showBalloon.
private static void showBalloon(@NotNull final Project project, String text, @NotNull final MessageType messageType) {
BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(text, messageType, null);
final Balloon balloon = balloonBuilder.createBalloon();
StudyEditor selectedStudyEditor = StudyUtils.getSelectedStudyEditor(project);
assert selectedStudyEditor != null;
balloon.show(StudyUtils.computeLocation(selectedStudyEditor.getEditor()), Balloon.Position.above);
Disposer.register(project, balloon);
}
use of com.intellij.openapi.ui.popup.BalloonBuilder in project intellij-community by JetBrains.
the class StudyCheckUtils method showTestResultPopUp.
public static void showTestResultPopUp(final String text, Color color, @NotNull final Project project) {
BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(text, null, color, null);
final Balloon balloon = balloonBuilder.createBalloon();
StudyUtils.showCheckPopUp(project, balloon);
}
use of com.intellij.openapi.ui.popup.BalloonBuilder in project intellij-community by JetBrains.
the class ExternalSystemUiUtil method showBalloon.
/**
* Asks to show balloon that contains information related to the given component.
*
* @param component component for which we want to show information
* @param messageType balloon message type
* @param message message to show
*/
public static void showBalloon(@NotNull JComponent component, @NotNull MessageType messageType, @NotNull String message) {
final BalloonBuilder builder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(message, messageType, null).setDisposable(ApplicationManager.getApplication()).setFadeoutTime(BALLOON_FADEOUT_TIME);
Balloon balloon = builder.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);
}
use of com.intellij.openapi.ui.popup.BalloonBuilder in project intellij-community by JetBrains.
the class GeneralCodeStylePanel method showError.
private static void showError(final JTextField field, final String message) {
BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(message, MessageType.ERROR.getDefaultIcon(), MessageType.ERROR.getPopupBackground(), null);
balloonBuilder.setFadeoutTime(1500);
final Balloon balloon = balloonBuilder.createBalloon();
final Rectangle rect = field.getBounds();
final Point p = new Point(0, rect.height);
final RelativePoint point = new RelativePoint(field, p);
balloon.show(point, Balloon.Position.below);
Disposer.register(ProjectManager.getInstance().getDefaultProject(), balloon);
}
Aggregations