Packagecom.yworks.support
Classpublic class DelegateUndoUnit
InheritanceDelegateUndoUnit Inheritance AbstractUndoUnit Inheritance Object

A convenience implementation of the IUndoUnit interface that uses simple delegate functions for the actual undo and redo operations.



Public Properties
 PropertyDefined By
 InheritedredoName : String
[read-only] Returns the name of the redo unit.
AbstractUndoUnit
 InheritedundoName : String
[read-only] The name of the undo unit.
AbstractUndoUnit
Public Methods
 MethodDefined By
  
DelegateUndoUnit(undoName:String, undoHandler:Function, redoHandler:Function, undoParam:Object = null, redoParam:Object = null)
Creates a new instance using the provided name and a undo and redo handler function as well as the parameters to pass to the handler functions.
DelegateUndoUnit
 Inherited
addUnit(unit:IUndoUnit):Boolean
This implementation does nothing and returns false.
AbstractUndoUnit
 Inherited
canRedo():Boolean
Determines whether this instance can currently redo its work.
AbstractUndoUnit
 Inherited
canUndo():Boolean
Determines whether this instance can currently undo its work.
AbstractUndoUnit
 Inherited
dispose():void
Frees all used resources.
AbstractUndoUnit
 Inherited
redo():void
Redoes the change that is represented by this unit.
AbstractUndoUnit
 Inherited
replaceUnit(unit:IUndoUnit):Boolean
This implementation does nothing and returns false.
AbstractUndoUnit
 Inherited
undo():void
Undoes the change that is represented by this unit.
AbstractUndoUnit
Protected Methods
 MethodDefined By
  
redoImpl():void
[override] Calls the redo delegate using the redo parameter.
DelegateUndoUnit
  
undoImpl():void
[override] Calls the undo delegate using the undo parameter.
DelegateUndoUnit
Constructor Detail
DelegateUndoUnit()Constructor
public function DelegateUndoUnit(undoName:String, undoHandler:Function, redoHandler:Function, undoParam:Object = null, redoParam:Object = null)

Creates a new instance using the provided name and a undo and redo handler function as well as the parameters to pass to the handler functions.

Parameters
undoName:String — The name of the undo unit.
 
undoHandler:Function — The undo handler delegate.
 
redoHandler:Function — The redo handler delegate.
 
undoParam:Object (default = null) — The undo parameter to pass to the delegate.
 
redoParam:Object (default = null) — The redo parameter to pass to the delegate.
Method Detail
redoImpl()method
override protected function redoImpl():void

Calls the redo delegate using the redo parameter.

undoImpl()method 
override protected function undoImpl():void

Calls the undo delegate using the undo parameter.