Package | org.restfulx.controllers |
Class | public class UndoRedoController |
Inheritance | UndoRedoController flash.events.EventDispatcher |
Warning: This will require matching support on the server-side unless you are using DirectCouchDBHTTPServiceProvider or AIRServiceProvider which implement this functionality out of the box.
You'll probably want to combine this with a general undo/redo solution for your application that works on other state not just RxModel instances.
private function init():void { Rx.enableUndoRedo = true; }
<mx:HBox> <mx:Button label="Undo" click="{Rx.undoredo.undo()}" enabled="{Rx.undoredo.canUndo()}"/> <mx:Button label="Redo" click="{Rx.undoredo.redo()}" enabled="{Rx.undoredo.canRedo()}"/> </mx:HBox>
Method | Defined by | ||
---|---|---|---|
UndoRedoController | |||
addChangeAction(action:Object):void
Pushes given composite action object onto the undo stack.
| UndoRedoController | ||
canRedo():Boolean
Indicates if redo can be performed
| UndoRedoController | ||
canUndo():Boolean
Indicates if undo can be performed
| UndoRedoController | ||
clear():void
Clear the undo/redo stacks
| UndoRedoController | ||
redo():void
Performs redo
| UndoRedoController | ||
undo():void
Performs undo
| UndoRedoController |
Constant | Defined by | ||
---|---|---|---|
NORMAL : int = 0 Flag indicating the invocation is normal
| UndoRedoController | ||
REDO : int = 2 Flag indicating the invocation is a redo operation
| UndoRedoController | ||
UNDO : int = 1 Flag indicating the invocation is an undo operation
| UndoRedoController |
UndoRedoController | () | constructor |
public function UndoRedoController()
addChangeAction | () | method |
public function addChangeAction(action:Object):void
Pushes given composite action object onto the undo stack.
Parametersaction:Object — Composite Action object that represents the state of the operation
|
canRedo | () | method |
public function canRedo():Boolean
Indicates if redo can be performed
ReturnsBoolean — true if redo can be performed
|
canUndo | () | method |
public function canUndo():Boolean
Indicates if undo can be performed
ReturnsBoolean — true if undo can be performed
|
clear | () | method |
public function clear():void
Clear the undo/redo stacks
redo | () | method |
public function redo():void
Performs redo
undo | () | method |
public function undo():void
Performs undo
NORMAL | constant |
public const NORMAL:int = 0
Flag indicating the invocation is normal
REDO | constant |
public const REDO:int = 2
Flag indicating the invocation is a redo operation
UNDO | constant |
public const UNDO:int = 1
Flag indicating the invocation is an undo operation