void () { JComponent component = getComponent(); if (component == null) return; Dimension size = component.getPreferredSize(); if (size.height == 0 && size.width == 0) return; if (!ourShowBalloonInHeadlessMode && ApplicationManager.getApplication().isHeadlessEnvironment()) return; BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createDialogBalloonBuilder(component, null).setSmallVariant(true); Color borderColor = UIManager.getColor("InplaceRefactoringPopup.borderColor"); if (borderColor != null) { balloonBuilder.setBorderColor(borderColor); } adjustBalloon(balloonBuilder); myBalloon = balloonBuilder.createBalloon(); Disposer.register(myProject, myBalloon); Disposer.register(myBalloon, () -> { releaseIfNotRestart(); myEditor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION, null); }); EditorUtil.disposeWithEditor(myEditor, myBalloon); myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE); showBalloonInEditor(); }