@Override
  public void setReadonlyFragmentModificationHandler(final @NotNull Document document, final ReadonlyFragmentModificationHandler handler) {
    final Document doc = document instanceof DocumentWindow ? ((DocumentWindow)document).getDelegate() : document;
    if (doc instanceof DocumentImpl) {
      ((DocumentImpl)document).setReadonlyFragmentModificationHandler(handler);
    }
  }
@Override
  public void setReadonlyFragmentModificationHandler(final @NotNull Document document, final ReadonlyFragmentModificationHandler handler)