String (PsiElement @NotNull [] elements) { int fileCount = 0, directoryCount = 0; for (PsiElement element : elements) { if (element instanceof PsiFile) { fileCount++; } else if (element instanceof PsiDirectory) { directoryCount++; } } if (directoryCount == 0) { return fileCount == 1 ? RefactoringBundle.message("move.file") : RefactoringBundle.message("move.files"); } if (fileCount == 0) { return directoryCount == 1 ? RefactoringBundle.message("move.directory") : RefactoringBundle.message("move.directories.with.dialog"); } return RefactoringBundle.message("move.files.and.directories"); }