GapContent.UndoRemove changes = null; if (content instanceof GapContent) changes = (GapContent.UndoRemove) temp;  if (changes != null && !(start == end)) {  ElementEdit edit = new ElementEdit (root, start, removed, added); event.addEdit(edit); }  if (shouldFire)
  public void remove(int offset, int length) throws BadLocationException  {    DefaultDocumentEvent event =      new DefaultDocumentEvent(offset, length,			       DocumentEvent.EventType.REMOVE);    removeUpdate(event);    content.remove(offset, length);    postRemoveUpdate(event);    fireRemoveUpdate(event);  }