Packageorg.restfulx.controllers
Classpublic class UndoRedoController
InheritanceUndoRedoController Inheritance flash.events.EventDispatcher

Adds undo redo support to the application.

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.


Example
Enabling Undo/Redo support
    private function init():void {
      Rx.enableUndoRedo = true;
    }
    

Using Undo/Redo in your application
    <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>
    



Public Methods
 MethodDefined 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
Public Constants
 ConstantDefined 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
Constructor detail
UndoRedoController()constructor
public function UndoRedoController()
Method detail
addChangeAction()method
public function addChangeAction(action:Object):void

Pushes given composite action object onto the undo stack.

Parameters
action:Object — Composite Action object that represents the state of the operation
canRedo()method 
public function canRedo():Boolean

Indicates if redo can be performed

Returns
Boolean — true if redo can be performed
canUndo()method 
public function canUndo():Boolean

Indicates if undo can be performed

Returns
Boolean — 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

Constant detail
NORMALconstant
public const NORMAL:int = 0

Flag indicating the invocation is normal

REDOconstant 
public const REDO:int = 2

Flag indicating the invocation is a redo operation

UNDOconstant 
public const UNDO:int = 1

Flag indicating the invocation is an undo operation