void (PackagingElementResolvingContext context) { final Module[] modules = context.getModulesProvider().getModules().clone(); Arrays.sort(modules, ModulesAlphaComparator.INSTANCE); if (modules.length > 1) { myModuleComboBox.addItem(null); } for (Module module : modules) { myModuleComboBox.addItem(module); } myModuleComboBox.setRenderer(SimpleListCellRenderer.create((label, value, index) -> { label.setIcon(value != null ? ModuleType.get(value).getIcon() : null); label.setText(value != null ? value.getName() : JavaCompilerBundle.message("all.modules")); })); ComboboxSpeedSearch search = new ComboboxSpeedSearch(myModuleComboBox, null) { @Override protected String getElementText(Object element) { return element instanceof Module ? ((Module)element).getName() : ""; } }; search.setupListeners(); }