Implement UndoManager's item() method