if (undo != null) event.addEdit(undo);
  public void insertString(int offset, String text, AttributeSet attributes)    throws BadLocationException  {    // Just return when no text to insert was given.    if (text == null || text.length() == 0)      return;    DefaultDocumentEvent event =      new DefaultDocumentEvent(offset, text.length(),			       DocumentEvent.EventType.INSERT);        writeLock();    UndoableEdit undo = content.insertString(offset, text);    insertUpdate(event, attributes);    writeUnlock();    fireInsertUpdate(event);    if (undo != null)      fireUndoableEditUpdate(new UndoableEditEvent(this, undo));  }