Search in sources :

Example 11 with BadLocationException

use of org.eclipse.che.ide.api.editor.text.BadLocationException in project che by eclipse.

the class AbstractDocument method replace.

/*
     * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
     */
public void replace(int pos, int length, String text, long modificationStamp) throws BadLocationException {
    if ((0 > pos) || (0 > length) || (pos + length > getLength()))
        throw new BadLocationException();
    DocumentEvent e = new DocumentEvent(this, pos, length, text);
    fireDocumentAboutToBeChanged(e);
    getStore().replace(pos, length, text);
    getTracker().replace(pos, length, text);
    fModificationStamp = modificationStamp;
    fNextModificationStamp = Math.max(fModificationStamp, fNextModificationStamp);
    e.fModificationStamp = fModificationStamp;
    fireDocumentChanged(e);
}
Also used : BadLocationException(org.eclipse.che.ide.api.editor.text.BadLocationException)

Aggregations

BadLocationException (org.eclipse.che.ide.api.editor.text.BadLocationException)11 BadPositionCategoryException (org.eclipse.che.ide.api.editor.text.BadPositionCategoryException)3 Position (org.eclipse.che.ide.api.editor.text.Position)2 RegionImpl (org.eclipse.che.ide.api.editor.text.RegionImpl)2 TypedPosition (org.eclipse.che.ide.api.editor.text.TypedPosition)2 MatchResult (com.google.gwt.regexp.shared.MatchResult)1 TypedRegionImpl (org.eclipse.che.ide.api.editor.text.TypedRegionImpl)1 Token (org.eclipse.che.ide.api.editor.text.rules.Token)1