Package | com.yworks.support |
Class | public class AbstractUndoUnit |
Inheritance | AbstractUndoUnit Object |
Implements | IUndoUnit |
Subclasses | DelegateUndoUnit, MementoUndoUnit |
IUndoUnit
.
Subclasses need to override undoImpl
and RedoImpl
, only.
See also
Property | Defined By | ||
---|---|---|---|
redoName : String [read-only]
Returns the name of the redo unit. | AbstractUndoUnit | ||
undoName : String [read-only]
The name of the undo unit. | AbstractUndoUnit |
Method | Defined By | ||
---|---|---|---|
AbstractUndoUnit(undoName:String = null, redoName:String = null)
Creates a new instance using the given name as undo and redo name. | AbstractUndoUnit | ||
This implementation does nothing and returns false. | AbstractUndoUnit | ||
canRedo():Boolean
Determines whether this instance can currently redo its work. | AbstractUndoUnit | ||
canUndo():Boolean
Determines whether this instance can currently undo its work. | AbstractUndoUnit | ||
dispose():void
Frees all used resources. | AbstractUndoUnit | ||
redo():void
Redoes the change that is represented by this unit. | AbstractUndoUnit | ||
replaceUnit(unit:IUndoUnit):Boolean
This implementation does nothing and returns false. | AbstractUndoUnit | ||
undo():void
Undoes the change that is represented by this unit. | AbstractUndoUnit |
Method | Defined By | ||
---|---|---|---|
redoImpl():void
Redoes the operation. | AbstractUndoUnit | ||
undoImpl():void
Undoes the operation. | AbstractUndoUnit |
redoName | property |
redoName:String
[read-only] Returns the name of the redo unit.
Depending on the implementation and context this might be a human readable representation of the redo action or a symbolic name that needs localization.
public function get redoName():String
undoName | property |
undoName:String
[read-only] The name of the undo unit.
Depending on the implementation and context this might be a human readable representation of the undo action or a symbolic name that needs localization.
public function get undoName():String
AbstractUndoUnit | () | Constructor |
public function AbstractUndoUnit(undoName:String = null, redoName:String = null)
Creates a new instance using the given name as undo and redo name.
ParametersundoName:String (default = null ) — The undo name.
| |
redoName:String (default = null ) — The redo name.
|
addUnit | () | method |
public function addUnit(unit:IUndoUnit):Boolean
This implementation does nothing and returns false
.
Allows for collapsing multiple units into one.
Implementation should try to incorporate the change of unit
into this
and if successful return true
.
This method will be called by the UndoEngine
to collapse multiple events into single events.
Typically this unit has been placed onto an undo
stack and unit
should be placed on top of it. Both units have been done
and might be undone in an upcoming action. If this method yields true
,
the provided unit will not be placed onto the stack but will be IDisposable.dispose
d.
Parameters
unit:IUndoUnit — The unit to incorporate that happened after this unit.
|
Boolean — Whether the state change of unit has been incorporated into this
unit and unit can be disposed of.
|
canRedo | () | method |
public function canRedo():Boolean
Determines whether this instance can currently redo
its work.
Boolean — Whether a call to redo will succeed.
|
canUndo | () | method |
public function canUndo():Boolean
Determines whether this instance can currently undo
its work.
Boolean — Whether a call to undo will succeed.
|
dispose | () | method |
public function dispose():void
Frees all used resources.
redo | () | method |
public function redo():void
Redoes the change that is represented by this unit.
This method will only succeed if canRedo
yields true
.
redoImpl | () | method |
protected function redoImpl():void
Redoes the operation.
Called by redo()
.
Subclasses have to override this method.
flash.errors:IllegalOperationError — if this method is not overridden.
|
replaceUnit | () | method |
public function replaceUnit(unit:IUndoUnit):Boolean
This implementation does nothing and returns false
.
Allows for collapsing multiple units into one.
Implementation should try to incorporate the change of unit
into this
and if successful return true
.
This method will be called by the UndoEngine
to collapse multiple events into single events.
Typically unit
has already been placed onto an undo stack and this
should be placed on top of it. Both units have been done and might be undone in an upcoming action.
If this method yields true
, this unit will replace the unit on the top of the stack and
unit
will be IDisposable.Dispose
d.
Parameters
unit:IUndoUnit — The unit to incorporate that happened before this unit.
|
Boolean — Whether the state change of unit has been incorporated into this unit and
unit can be disposed of.
|
undo | () | method |
public function undo():void
Undoes the change that is represented by this unit.
This method will only succeed if canUndo
yields true
.
undoImpl | () | method |
protected function undoImpl():void
Undoes the operation.
Called by undo()
.
Subclasses have to override this method.
flash.errors:IllegalOperationError — if this method is not overridden.
|