JComponent () { JLabel informationalLabel = new JLabel(); informationalLabel.setText(PropertiesBundle.message("copy.property.0.label", ContainerUtil.getFirstItem(myProperties).getName())); informationalLabel.setFont(informationalLabel.getFont().deriveFont(Font.BOLD)); final Collection<PropertiesFile> propertiesFiles = new ArrayList<>(); GlobalSearchScope searchScope = ProjectScope.getContentScope(myProject); PropertiesReferenceManager .getInstance(myProject) .processPropertiesFiles(searchScope, (baseName, propertiesFile) -> { propertiesFiles.add(propertiesFile); return true; }, BundleNameEvaluator.BASE_NAME); PsiFileSystemItem[] resourceBundlesAsFileSystemItems = propertiesFiles .stream() .map(PropertiesFile::getResourceBundle) .distinct() .filter(b -> b.getBaseDirectory() != null) .sorted(Comparator.comparing(ResourceBundle::getBaseName)) .map(ResourceBundleAsFileSystemItem::new) .toArray(PsiFileSystemItem[]::new); final ComboBox<PsiFileSystemItem> resourceBundleComboBox = new ComboBox<>(resourceBundlesAsFileSystemItems); ComboboxSpeedSearch search = new ComboboxSpeedSearch(resourceBundleComboBox, null) { @Override protected String getElementText(Object element) { return ((PsiFileSystemItem)element).getName(); } }; search.setupListeners(); resourceBundleComboBox.setRenderer(new GotoFileCellRenderer(500) { @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { final Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); UIUtil.setBackgroundRecursively(component, isSelected ? UIUtil.getListSelectionBackground(true) : resourceBundleComboBox.getBackground()); return component; } }); resourceBundleComboBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(@NotNull ItemEvent e) { myCurrentResourceBundle = ((ResourceBundleAsFileSystemItem)e.getItem()).getResourceBundle(); } }); resourceBundleComboBox.setSelectedItem(new ResourceBundleAsFileSystemItem(myCurrentResourceBundle)); myPropertyNameTextField = new JBTextField(ContainerUtil.getFirstItem(myProperties).getKey()); myPropertyNameTextField.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(@NotNull DocumentEvent e) { myCurrentPropertyName = myPropertyNameTextField.getText(); } }); return FormBuilder .createFormBuilder() .addComponent(informationalLabel) .addLabeledComponent(PropertiesBundle.message("copy.destination.new.name.label"), myPropertyNameTextField, UIUtil.LARGE_VGAP) .addLabeledComponent(PropertiesBundle.message("copy.destination.resource.bundle.label"), resourceBundleComboBox) .getPanel(); }