List of usage examples for com.intellij.openapi.ui.popup BalloonBuilder setFadeoutTime
@NotNull
BalloonBuilder setFadeoutTime(long fadeoutTime);
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.application.options.GeneralCodeStylePanel.java
License:Apache License
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); }
From source file:com.intellij.find.impl.livePreview.LivePreview.java
License:Apache License
private void showBalloon(Editor editor, String replacementPreviewText) { if (ApplicationManager.getApplication().isUnitTestMode()) { myReplacementPreviewText = replacementPreviewText; return;/*from w w w . java 2 s .c o m*/ } ReplacementView replacementView = new ReplacementView(replacementPreviewText); BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(replacementView); balloonBuilder.setFadeoutTime(0); balloonBuilder.setFillColor(IdeTooltipManager.GRAPHITE_COLOR); balloonBuilder.setAnimationCycle(0); balloonBuilder.setHideOnClickOutside(false); balloonBuilder.setHideOnKeyOutside(false); balloonBuilder.setHideOnAction(false); balloonBuilder.setCloseButtonEnabled(true); myReplacementBalloon = balloonBuilder.createBalloon(); myReplacementBalloon.show(new ReplacementBalloonPositionTracker(editor), Balloon.Position.above); }
From source file:org.codinjutsu.tools.jenkins.logic.RssLogic.java
License:Apache License
private void displayErrorMessageInABalloon(String message) { BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(message, MessageType.ERROR, null);/*from ww w .java2 s .c o m*/ final Balloon balloon = balloonBuilder.setFadeoutTime(TimeUnit.SECONDS.toMillis(1)).createBalloon(); GuiUtil.runInSwingThread(new Runnable() { @Override public void run() { balloon.show(new RelativePoint(JenkinsWidget.getInstance(project).getComponent(), new Point(0, 0)), Balloon.Position.above); } }); }