Java Code Examples for com.intellij.openapi.ui.popup.BalloonBuilder#setHideOnClickOutside()
The following examples show how to use
com.intellij.openapi.ui.popup.BalloonBuilder#setHideOnClickOutside() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LivePreview.java From consulo with Apache License 2.0 | 6 votes |
private void showBalloon(Editor editor, String replacementPreviewText) { if (ApplicationManager.getApplication().isUnitTestMode()) { myReplacementPreviewText = replacementPreviewText; return; } 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(); EditorUtil.disposeWithEditor(editor, myReplacementBalloon); myReplacementBalloon.show(new ReplacementBalloonPositionTracker(editor), Balloon.Position.below); }
Example 2
Source File: PropertyEditorPanel.java From flutter-intellij with BSD 3-Clause "New" or "Revised" License | 5 votes |
public static Balloon showPopupHelper( InspectorGroupManagerService inspectorService, Project project, @Nullable DiagnosticsNode node, @NotNull InspectorService.Location location, FlutterDartAnalysisServer service ) { final Color GRAPHITE_COLOR = new JBColor(new Color(236, 236, 236, 215), new Color(60, 63, 65, 215)); final Disposable panelDisposable = Disposer.newDisposable(); final PropertyEditorPanel panel = new PropertyEditorPanel(inspectorService, project, service, true, true, panelDisposable); final StableWidgetTracker tracker = new StableWidgetTracker(location, service, project, panelDisposable); final EventStream<VirtualFile> activeFile = new EventStream<>(location.getFile()); panel.initalize(node, tracker.getCurrentOutlines(), activeFile); panel.setBackground(GRAPHITE_COLOR); panel.setOpaque(false); final BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(panel); balloonBuilder.setFadeoutTime(0); balloonBuilder.setFillColor(GRAPHITE_COLOR); balloonBuilder.setAnimationCycle(0); balloonBuilder.setHideOnClickOutside(true); balloonBuilder.setHideOnKeyOutside(false); balloonBuilder.setHideOnAction(false); balloonBuilder.setCloseButtonEnabled(false); balloonBuilder.setBlockClicksThroughBalloon(true); balloonBuilder.setRequestFocus(true); balloonBuilder.setShadow(true); final Balloon balloon = balloonBuilder.createBalloon(); Disposer.register(balloon, panelDisposable); return balloon; }
Example 3
Source File: PropertyEditorPanel.java From flutter-intellij with BSD 3-Clause "New" or "Revised" License | 5 votes |
public static Balloon showPopupHelper( InspectorGroupManagerService inspectorService, Project project, @Nullable DiagnosticsNode node, @NotNull InspectorService.Location location, FlutterDartAnalysisServer service ) { final Color GRAPHITE_COLOR = new JBColor(new Color(236, 236, 236, 215), new Color(60, 63, 65, 215)); final Disposable panelDisposable = Disposer.newDisposable(); final PropertyEditorPanel panel = new PropertyEditorPanel(inspectorService, project, service, true, true, panelDisposable); final StableWidgetTracker tracker = new StableWidgetTracker(location, service, project, panelDisposable); final EventStream<VirtualFile> activeFile = new EventStream<>(location.getFile()); panel.initalize(node, tracker.getCurrentOutlines(), activeFile); panel.setBackground(GRAPHITE_COLOR); panel.setOpaque(false); final BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(panel); balloonBuilder.setFadeoutTime(0); balloonBuilder.setFillColor(GRAPHITE_COLOR); balloonBuilder.setAnimationCycle(0); balloonBuilder.setHideOnClickOutside(true); balloonBuilder.setHideOnKeyOutside(false); balloonBuilder.setHideOnAction(false); balloonBuilder.setCloseButtonEnabled(false); balloonBuilder.setBlockClicksThroughBalloon(true); balloonBuilder.setRequestFocus(true); balloonBuilder.setShadow(true); final Balloon balloon = balloonBuilder.createBalloon(); Disposer.register(balloon, panelDisposable); return balloon; }
Example 4
Source File: UsagePreviewPanel.java From consulo with Apache License 2.0 | 5 votes |
private static void showBalloon(Project project, Editor editor, TextRange range, @Nonnull FindModel findModel) { try { String replacementPreviewText = FindManager.getInstance(project).getStringToReplace(editor.getDocument().getText(range), findModel, range.getStartOffset(), editor.getDocument().getText()); if (!Registry.is("ide.find.show.replacement.hint.for.simple.regexp") && (Comparing.equal(replacementPreviewText, findModel.getStringToReplace()))) { return; } 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); Balloon balloon = balloonBuilder.createBalloon(); EditorUtil.disposeWithEditor(editor, balloon); balloon.show(new ReplacementBalloonPositionTracker(project, editor, range, findModel), Balloon.Position.below); editor.putUserData(REPLACEMENT_BALLOON_KEY, balloon); } catch (FindManager.MalformedReplacementStringException e) { //Not a problem, just don't show balloon in this case } }
Example 5
Source File: GotItMessage.java From consulo with Apache License 2.0 | 5 votes |
public void show(RelativePoint point, Balloon.Position position) { final GotItPanel panel = new GotItPanel(); panel.myTitle.setText(myTitle); panel.myMessage.setText(myMessage); panel.myButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); final BalloonBuilder builder = JBPopupFactory.getInstance().createBalloonBuilder(panel.myRoot); if (myDisposable != null) { builder.setDisposable(myDisposable); } builder.setFillColor(UIUtil.getListBackground()); builder.setHideOnClickOutside(false); builder.setHideOnAction(false); builder.setHideOnFrameResize(false); builder.setHideOnKeyOutside(false); builder.setShowCallout(myShowCallout); builder.setBlockClicksThroughBalloon(true); final Balloon balloon = builder.createBalloon(); panel.myButton.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { balloon.hide(); if (myCallback != null) { myCallback.run(); } } }); balloon.show(point, position); }