After trying what camickr suggested, it seems that this is the order of events:
When typing in the editor pane (including cutting, copying and pasting) or changing the document font/style, the document will fire a DocumentEvent before it fires an UndoableEditEvent.
When calling UndoableEdit.undo() or UndoableEdit.redo(), only a corresponding DocumentEvent will be fired.