DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE);  try { writeLock();   removeUpdate(event); UndoableEdit temp = content.remove(offset, length);  postRemoveUpdate(event); fireRemoveUpdate(event);
if (documentFilter != null) documentFilter.remove(getBypass(), offset, length); else removeImpl(offset, length);
  public void remove(int offset, int length) throws BadLocationException  {    DefaultDocumentEvent event =      new DefaultDocumentEvent(offset, length,			       DocumentEvent.EventType.REMOVE);        try      {    writeLock();                // The order of the operations below is critical!                removeUpdate(event);        UndoableEdit temp = content.remove(offset, length);            postRemoveUpdate(event);    fireRemoveUpdate(event);  }    finally      {        writeUnlock();      }   }