if (parentNode instanceof IDOMElement) {
int docLength = document.getLength();
int startOffset = ((IDOMElement) newBean).getStartOffset() - 1;
int length = ((IDOMElement) newBean).getLength() + 2;
formatter.formatDocument(document, startOffset >= 0 ? startOffset : 0,
length + startOffset <= docLength ? length : docLength - startOffset);
}
if (classAttribute instanceof AttrImpl && newBean instanceof IDOMNode) {
cursorPosition = ((IDOMNode) newBean).getStartOffset()