protected AbstractEdit getPrevEdit(UndoManager undoManager) {
        int insertionPoint = getIndexOfNextAdd(undoManager);
        if (insertionPoint < 1) {
            return new NoEdit();
        }
        Class c = undoManager.getClass();
        Field field;
        try {
            field = c.getDeclaredField("edits");
        } catch (NoSuchFieldException e) {
            return new NoEdit();
        }
        Vector<UndoableEdit> edits;
        try {
            edits = (Vector<UndoableEdit>) field.get(undoManager);
        } catch (IllegalAccessException e) {
            return new NoEdit();
        }
        UndoableEdit edit = edits.get(insertionPoint - 1);
        return (AbstractEdit) edit;
    }