void (@NotNull Project project, PsiElement @NotNull [] elements, DataContext dataContext) { final Module module = LangDataKeys.MODULE_CONTEXT.getData(dataContext); LOG.assertTrue(module != null); final PsiElement element = elements.length == 1 ? elements[0] : PsiElementRenameHandler.getElement(dataContext); LOG.assertTrue(element != null); PsiElementRenameHandler.rename( element, project, element, CommonDataKeys.EDITOR.getData(dataContext), dataContext.getData(PsiElementRenameHandler.DEFAULT_NAME), new RenameModuleAndDirectoryProcessor(module) ); }