use of com.intellij.openapi.ui.popup.Balloon in project intellij-community by JetBrains.
the class StudyUtils method showErrorPopupOnToolbar.
public static void showErrorPopupOnToolbar(@NotNull Project project, String content) {
final Balloon balloon = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(content, MessageType.ERROR, null).createBalloon();
showCheckPopUp(project, balloon);
}
use of com.intellij.openapi.ui.popup.Balloon 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.Balloon 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.Balloon 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.Balloon in project intellij-community by JetBrains.
the class PyStudyShowTutorial method projectOpened.
@Override
public void projectOpened() {
ApplicationManager.getApplication().invokeLater(new DumbAwareRunnable() {
@Override
public void run() {
ApplicationManager.getApplication().runWriteAction(new DumbAwareRunnable() {
@Override
public void run() {
if (PropertiesComponent.getInstance().getBoolean(ourShowPopup, true)) {
final String content = "<html>If you'd like to learn more about PyCharm Edu, " + "click <a href=\"https://www.jetbrains.com/pycharm-edu/quickstart/\">here</a> to watch a tutorial</html>";
final Notification notification = new Notification("Watch Tutorials!", "", content, NotificationType.INFORMATION, new NotificationListener.UrlOpeningListener(true));
Notifications.Bus.notify(notification);
Balloon balloon = notification.getBalloon();
if (balloon != null) {
balloon.addListener(new JBPopupAdapter() {
@Override
public void onClosed(LightweightWindowEvent event) {
notification.expire();
}
});
}
notification.whenExpired(() -> PropertiesComponent.getInstance().setValue(ourShowPopup, false, true));
}
}
});
}
});
}
Aggregations