public void removeAllPages(Project project) {
    if (!pagesInDocument.isEmpty()) {
      pagesInDocument.clear();
      symbolOffsetToEndOfPage.clear();
      runAsWriteAction(project, () -> myDocument.deleteString(0, myDocument.getTextLength()));
    }
  }
public void removeAllPages(Project project)