void () { JBPopupListener listener = new JBPopupListener() { @Override public void onClosed(@NotNull LightweightWindowEvent event) { isShowQueue = false; } }; String commandQueueName = getConsoleDisplayName(getProject()); myCommandQueue = JBPopupFactory.getInstance() .createComponentPopupBuilder(myCommandQueuePanel, null) .setMovable(true) .setResizable(true) .setShowShadow(true) .setCancelOnClickOutside(false) .setTitle(PyBundle.message( "python.console.command.queue.add.title", commandQueueName != null ? commandQueueName : "Python Console")) .setCancelButton(new MinimizeButton(IdeBundle.message("tooltip.hide"))) .addListener(listener) .setBorderColor(JBColor.background()) .setCancelOnOtherWindowOpen(true) .createPopup(); var title = (TitlePanel)((AbstractPopup)myCommandQueue).getTitle(); title.getLabel().setForeground(JBColor.foreground()); title.setActive(true); ((AbstractPopup)myCommandQueue).addResizeListener(this::commandQueueWasResized, this); if (commandQueueDimension != null) { myCommandQueue.setSize(commandQueueDimension); } var editor = getConsoleEditor(); if (UIUtil.isShowing(editor.getContentComponent())) { myCommandQueue.showInBestPositionFor(getConsoleEditor()); } Disposer.register(this, myCommandQueue); }