@Override
  public ReadonlyFragmentModificationHandler getReadonlyFragmentModificationHandler(final @NotNull Document document) {
    final Document doc = document instanceof DocumentWindow ? ((DocumentWindow)document).getDelegate() : document;
    final ReadonlyFragmentModificationHandler docHandler =
      doc instanceof DocumentImpl ? ((DocumentImpl)doc).getReadonlyFragmentModificationHandler() : null;
    return docHandler == null ? myReadonlyFragmentsHandler : docHandler;
  }
@Override
  public ReadonlyFragmentModificationHandler getReadonlyFragmentModificationHandler(final @NotNull Document document)