content.insertString(offset, text);
writeLock(); UndoableEdit temp = content.insertString(offset, text); writeUnlock();  GapContent.UndoInsertString changes = null; if (content instanceof GapContent) changes = (GapContent.UndoInsertString) temp;
  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);    content.insertString(offset, text);    insertUpdate(event, attributes);    fireInsertUpdate(event);  }