/** * Inserts text at the given point. Triggers a single operation event matching the * executed insertion. * * @param point Point at which to insert text * @param text Text to insert */ public void insertText(Point<N> point, String text) { Point.checkPoint(this, point, "MutableDocumentImpl.insertText"); insertText(doc.getLocation(point), text); }
@Override public void insertText(int location, String text) { Preconditions.checkPositionIndex(location, size()); // TODO(danilatos): Get the schema constraints from the document // and use the corresponding permitted characters from there. // text = getPermittedCharactersForPoint(point).convertString(text); try { begin(); consume(insertText(text, at(location))); } finally { end(); } }