if (edit instanceof ElementChange)
if (edit instanceof DocumentEvent.ElementChange)
    public boolean addEdit(UndoableEdit edit)    {      if (edit instanceof ElementChange)        {          ElementChange elEdit = (ElementChange) edit;          changes.put(elEdit.getElement(), elEdit);        }      return super.addEdit(edit);    }