void (@NotNull final AnActionEvent e) { final List<T> elements = myEntriesChooser.getSelectedElements(); if (elements.size() > 1) { final String newName = Messages.showInputDialog( ProjectLayoutPanel.this, JavaUiBundle.message("label.enter.new.name.for.merge.result"), JavaUiBundle.message("dialog.title.merge.module.or.library"), Messages.getQuestionIcon(), getElementName(elements.get(0)), getValidator()); if (newName != null) { final T merged = merge(elements); setElementName(merged, newName); for (T element : elements) { myEntriesChooser.removeElement(element); } myEntriesChooser.addElement(merged, true, new EntryProperties(merged)); myEntriesChooser.sort(COMPARATOR); myEntriesChooser.selectElements(Collections.singleton(merged)); } } }