boolean (PsiElement[] elements) { if (elements == null || elements.length == 0) return false; for (PsiElement element : elements) { VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element); if (virtualFile == null || virtualFile instanceof LightVirtualFile) { return false; } if (!WritingAccessProvider.isPotentiallyWritable(virtualFile, element.getProject())) { return false; } } return true; }