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