List of usage examples for com.intellij.openapi.ui.popup JBPopupFactory createHtmlTextBalloonBuilder
@NotNull
public abstract BalloonBuilder createHtmlTextBalloonBuilder(@NotNull String htmlContent,
MessageType messageType, @Nullable HyperlinkListener listener);
From source file:com.igormaznitsa.ideamindmap.utils.IdeaUtils.java
License:Apache License
public static void showPopup(@Nonnull final String text, @Nonnull final MessageType type) { SwingUtils.safeSwing(new Runnable() { @Override/*from w w w . j av a2 s . co m*/ public void run() { final JBPopupFactory factory = JBPopupFactory.getInstance(); final BalloonBuilder builder = factory .createHtmlTextBalloonBuilder(StringEscapeUtils.escapeHtml(text), type, null); final Balloon balloon = builder.createBalloon(); balloon.setAnimationEnabled(true); final Component frame = WindowManager.getInstance().findVisibleFrame(); if (frame != null) balloon.show(new RelativePoint(frame, new Point(frame.getWidth(), frame.getHeight())), Balloon.Position.below); } }); }
From source file:com.intellij.lang.customFolding.GotoCustomRegionAction.java
License:Apache License
private static void notifyCustomRegionsUnavailable(@NotNull Editor editor, @NotNull Project project) { final JBPopupFactory popupFactory = JBPopupFactory.getInstance(); Balloon balloon = popupFactory .createHtmlTextBalloonBuilder(IdeBundle.message("goto.custom.region.message.unavailable"), MessageType.INFO, null) .setFadeoutTime(2000).setHideOnClickOutside(true).setHideOnKeyOutside(true).createBalloon(); Disposer.register(project, balloon); balloon.show(popupFactory.guessBestPopupLocation(editor), Balloon.Position.below); }