void (@NotNull Consumer callback, @NotNull ColoredListCellRenderer renderer, boolean async) { if (callback instanceof SearchPopupCallback) { this.callback = (SearchPopupCallback)callback; } Insets ipad = renderer.getIpad(); ipad.left = ipad.right = getXOffset(); renderer.setFont(myEditor.getFont()); //noinspection unchecked,deprecation myPopup = JBPopupFactory.getInstance().createListPopupBuilder(list = new JBList<>(model)) .setMovable(false).setResizable(false) // In general, we want to keep focus on the text field, so that popup works as autocompletion options, and it's still possible // to type more characters. But for screen readers, popup without focus is not accessible, therefore we need to move focus there. .setRequestFocus(ScreenReader.isActive()) .setAccessibleName(IdeBundle.message("plugin.manager.search.filters.popup.accessible.name")) .setItemChosenCallback(callback).setFont(myEditor.getFont()) .setRenderer(renderer).createPopup(); myEvent = new LightweightWindowEvent(myPopup); skipCaretEvent = true; myPopup.addListener(myListener); myEditor.addCaretListener(this); myDialogComponent = myEditor.getRootPane().getParent(); if (myDialogComponent != null) { myDialogComponent.addComponentListener(this); } if (async) { //noinspection SSBasedInspection SwingUtilities.invokeLater(this::show); } else { show(); } }