}
getDocument().getAnnotations().clear();
try {
DocumentContent newContent = new DocumentContentImpl(newText);
// Edit keeps making problems when the replacement content has
// zero length so for now we just replace the content.
//getDocument().setContent(new DocumentContentImpl(newText));