}
  public UndoableEdit insertString(int where, String str)    throws BadLocationException  {    checkLocation(where, 0);    if (where == this.count)      throw new BadLocationException("Invalid location", 1);    if (str == null)      throw new NullPointerException();    char[] insert = str.toCharArray();    char[] temp = new char[this.content.length + insert.length];    this.count += insert.length;    // Copy array and insert the string.    if (where > 0)      System.arraycopy(this.content, 0, temp, 0, where);    System.arraycopy(insert, 0, temp, where, insert.length);    System.arraycopy(this.content, where, temp, (where + insert.length),         (temp.length - where - insert.length));    if (this.content.length < temp.length)      this.content = new char[temp.length];    // Copy the result in the original char array.    System.arraycopy(temp, 0, this.content, 0, temp.length);    // Move all the positions.    Vector refPos = getPositionsInRange(this.positions, where,                                         temp.length - where);    Iterator iter = refPos.iterator();    while (iter.hasNext())      {        StickyPosition p = (StickyPosition)iter.next();        p.setOffset(p.getOffset() + str.length());      }    InsertUndo iundo = new InsertUndo(where, insert.length);    return iundo;  }