private static DocumentWindow getDocumentWindow(@NotNull PsiElement element) {
    PsiFile file = element.getContainingFile();
    if (file == null) {
      return null;
    }
    Document document = PsiDocumentManager.getInstance(file.getProject()).getCachedDocument(file);
    return document instanceof DocumentWindow ? (DocumentWindow)document : null;
  }
private static DocumentWindow getDocumentWindow(@NotNull PsiElement element)