void (@Nullable String searchText, boolean selectSearchText, @NotNull AnActionEvent initEvent) { IdeEventQueue.getInstance().getPopupManager().closeAllPopups(false); Project project = initEvent.getProject(); myRunAnythingUI = createView(initEvent); if (searchText != null && !searchText.isEmpty()) { myRunAnythingUI.getSearchField().setText(searchText); } predefineSelectedText(searchText); if (selectSearchText) { myRunAnythingUI.getSearchField().selectAll(); } myBalloon = JBPopupFactory.getInstance().createComponentPopupBuilder(myRunAnythingUI, myRunAnythingUI.getSearchField()) .setProject(myProject) .setModalContext(false) .setCancelOnClickOutside(true) .setRequestFocus(true) .setCancelKeyEnabled(false) .setCancelCallback(() -> { if (isShown() && !Objects.equals(myRunAnythingUI.getUserInputText(), searchText)) { saveSearchText(); } return true; }) .setResizable(true) .setMovable(true) .setDimensionServiceKey(myProject, LOCATION_SETTINGS_KEY, true) .setLocateWithinScreenBounds(false) .createPopup(); Disposer.register(myBalloon, myRunAnythingUI); if (project != null) { Disposer.register(project, myBalloon); } Dimension size = myRunAnythingUI.getMinimumSize(); JBInsets.addTo(size, myBalloon.getContent().getInsets()); myBalloon.setMinimumSize(size); Disposer.register(myBalloon, () -> { saveSize(); myRunAnythingUI = null; myBalloon = null; myBalloonFullSize = null; }); if (myRunAnythingUI.getViewType() == RunAnythingPopupUI.ViewType.SHORT) { myBalloonFullSize = WindowStateService.getInstance(myProject).getSize(LOCATION_SETTINGS_KEY); Dimension prefSize = myRunAnythingUI.getPreferredSize(); myBalloon.setSize(prefSize); } calcPositionAndShow(project, myBalloon); }