Undo the last action.

        This will call `undo()` on all controllers involved in this action.
174967
def undo(self):
        
        controllers = self.back()
        if controllers is None:
            ups = ()
        else:
            ups = tuple([controller.undo()
                        for controller in controllers])
        if self.process_ups is not None:
            return self.process_ups(ups)
        else:
            return ups
122002
public void clear() {

        m_undo.clear();
        m_redo.clear();
        m_entity = null;
        m_editor = null;
        m_rootHandler = null;
    }
385800
function UndoManager(callback, panels) {

        var undoObj = this;
        var undoStack = []; // A stack of undo states
        var stackPtr = 0; // The index of the current state
        var mode = "none";
        var lastState; // The last state
        var timer; // The setTimeout handle for cancelling the timer
        var inputStateObj;

        // Set the mode for later logic steps.
        var setMode = function (newMode, noSave) {
            if (mode != newMode) {
                mode = newMode;
                if (!noSave) {
                    saveState();
                }
            }

            if (!uaSniffed.isIE || mode != "moving") {
                timer = setTimeout(refreshState, 1);
            }
            else {
                inputStateObj = null;
            }
        };

        var refreshState = function (isInitialState) {
            inputStateObj = new TextareaState(panels, isInitialState);
            timer = undefined;
        };

        this.setCommandMode = function () {
            mode = "command";
            saveState();
            timer = setTimeout(refreshState, 0);
        };

        this.canUndo = function () {
            return stackPtr > 1;
        };

        this.canRedo = function () {
            if (undoStack[stackPtr + 1]) {
                return true;
            }
            return false;
        };

        // Removes the last state and restores it.
        this.undo = function () {

            if (undoObj.canUndo()) {
                if (lastState) {
                    // What about setting state -1 to null or checking for undefined?
                    lastState.restore();
                    lastState = null;
                }
                else {
                    undoStack[stackPtr] = new TextareaState(panels);
                    undoStack[--stackPtr].restore();

                    if (callback) {
                        callback();
                    }
                }
            }

            mode = "none";
            panels.input.focus();
            refreshState();
        };

        // Redo an action.
        this.redo = function () {

            if (undoObj.canRedo()) {

                undoStack[++stackPtr].restore();

                if (callback) {
                    callback();
                }
            }

            mode = "none";
            panels.input.focus();
            refreshState();
        };

        // Push the input area state to the stack.
        var saveState = function () {
            var currState = inputStateObj || new TextareaState(panels);

            if (!currState) {
                return false;
            }
            if (mode == "moving") {
                if (!lastState) {
                    lastState = currState;
                }
                return;
            }
            if (lastState) {
                if (undoStack[stackPtr - 1].text != lastState.text) {
                    undoStack[stackPtr++] = lastState;
                }
                lastState = null;
            }
            undoStack[stackPtr++] = currState;
            undoStack[stackPtr + 1] = null;
            if (callback) {
                callback();
            }
        };

        var handleCtrlYZ = function (event) {

            var handled = false;

            if (event.ctrlKey || event.metaKey) {

                // IE and Opera do not support charCode.
                var keyCode = event.charCode || event.keyCode;
                var keyCodeChar = String.fromCharCode(keyCode);

                switch (keyCodeChar) {

                    case "y":
                        undoObj.redo();
                        handled = true;
                        break;

                    case "z":
                        if (!event.shiftKey) {
                            undoObj.undo();
                        }
                        else {
                            undoObj.redo();
                        }
                        handled = true;
                        break;
                }
            }

            if (handled) {
                if (event.preventDefault) {
                    event.preventDefault();
                }
                if (window.event) {
                    window.event.returnValue = false;
                }
                return;
            }
        };

        // Set the mode depending on what is going on in the input area.
        var handleModeChange = function (event) {

            if (!event.ctrlKey && !event.metaKey) {

                var keyCode = event.keyCode;

                if ((keyCode >= 33 && keyCode <= 40) || (keyCode >= 63232 && keyCode <= 63235)) {
                    // 33 - 40: page up/dn and arrow keys
                    // 63232 - 63235: page up/dn and arrow keys on safari
                    setMode("moving");
                }
                else if (keyCode == 8 || keyCode == 46 || keyCode == 127) {
                    // 8: backspace
                    // 46: delete
                    // 127: delete
                    setMode("deleting");
                }
                else if (keyCode == 13) {
                    // 13: Enter
                    setMode("newlines");
                }
                else if (keyCode == 27) {
                    // 27: escape
                    setMode("escape");
                }
                else if ((keyCode < 16 || keyCode > 20) && keyCode != 91) {
                    // 16-20 are shift, etc. 
                    // 91: left window key
                    // I think this might be a little messed up since there are
                    // a lot of nonprinting keys above 20.
                    setMode("typing");
                }
            }
        };

        var setEventHandlers = function () {
            util.addEvent(panels.input, "keypress", function (event) {
                // keyCode 89: y
                // keyCode 90: z
                if ((event.ctrlKey || event.metaKey) && (event.keyCode == 89 || event.keyCode == 90)) {
                    event.preventDefault();
                }
            });

            var handlePaste = function () {
                if (uaSniffed.isIE || (inputStateObj && inputStateObj.text != panels.input.value)) {
                    if (timer == undefined) {
                        mode = "paste";
                        saveState();
                        refreshState();
                    }
                }
            };

            util.addEvent(panels.input, "keydown", handleCtrlYZ);
            util.addEvent(panels.input, "keydown", handleModeChange);
            util.addEvent(panels.input, "mousedown", function () {
                setMode("moving");
            });

            panels.input.onpaste = handlePaste;
            panels.input.ondrop = handlePaste;
        };

        var init = function () {
            setEventHandlers();
            refreshState(true);
            saveState();
        };

        init();
    }
568627
public function deleteAction()
    {
        $model = $this->getModel();
        $model->applyRequest($this->getRequest());

        $model->delete();
        $this->_reroute(array($this->getRequest()->getActionKey() => 'index', MUTil_Model::REQUEST_ID => null));
    }
693907
def backwards(self, backwards):
        """"""

        if self._backwards is not None:
            raise ValueError('Backwards action already specified.')

        self._backwards = backwards
        return backwards
972959
public function cleanup() {
        global $DB;
        $courseid = $this->controller->get_courseid();
        if ($this->is_temporary_course_created($courseid) && $course = $DB->get_record('course', array('id' => $courseid))) {
            $course->deletesource = 'restore';
            delete_course($course, false);
        }
    }
1342683
def _del_controller(self, uid):
        
        try:
            self.controllers.pop(uid)
            e = Event(uid, E_DISCONNECT)
            self.queue.put_nowait(e)
        except KeyError:
            # There is no such controller, ignore the command
            pass
1201529
def undo(self):
        
        if self.grouping_level() == 1:
            self.end_grouping()
        if self._open:
            raise IndexError
        self.undo_nested_group()
        self.notify()
84108
def on_top_level_changed(self, top_level):
        """"""
        if top_level:
            self.undock_action.setDisabled(True)
        else:
            self.undock_action.setDisabled(False)
1097519
public void redo() {

        // If there is at least one command to redo
        if (this.undoneStack.size() > 0) {
            // add the last undone command on the command stack
            this.commandStack.add(this.undoneStack.get(this.undoneStack.size() - 1));
            // remove the command to redo of the undone stack.
            this.undoneStack.remove(this.undoneStack.size() - 1);
            // Call Redo method
            this.commandStack.get(this.commandStack.size() - 1)
                             .run(WBuilder.wave().addDatas(WBuilder.waveData(UndoRedoWaves.UNDO_REDO, false)));
        } else {
            // End of stack, do nothing
            LOGGER.info("No more command to redo, end of stack");
        }
    }
1067310
public void unbind() {
        if (itemView == null || controller == null) {
            return;
        }
        if (data != null) {
            this.controller.unmountView(data, itemView);
        }
    }
934519
def undo_action_name(self):
        
        if self._open:
            return self._open[-1].name
        elif self._undo:
            return self._undo[-1].name
        return ""
483699
def reset_actions(self):
        
        if self._driver.w3c:
            self.w3c_actions.clear_actions()
        self._actions = []
19410
public void reverse() {
        for (int i = 0, size = mTransitionControls.size(); i < size; i++) {
            mTransitionControls.get(i).reverse();
        }
    }
1077349
public boolean undo() {
    LOGGER.trace("undo, before, size: " + changes.size() + " pos: " + position.get()
        + " validPos: " + validPosition.get());
    Change lastChange = prev();
    if (lastChange != null) {
      doWithoutListeners(lastChange.getSetting(), lastChange::undo);
      LOGGER.trace("undo, after, size: " + changes.size() + " pos: " + position.get()
          + " validPos: " + validPosition.get());
      return true;
    }
    return false;
  }
1132
def register_actions(self, shortcut_manager):
        
        shortcut_manager.add_callback_for_action("undo", self.undo)
        shortcut_manager.add_callback_for_action("redo", self.redo)
540739
public void revert() {
		for (Iterator i = listeners.iterator(); i.hasNext();) {
			((CommitTriggerListener) i.next()).revert();
		}
	}