Package | com.yworks.support |
Class | public class CompoundUndoUnit |
Inheritance | CompoundUndoUnit Object |
Implements | IUndoUnit |
IUndoUnit
instances to support undoability.
Property | Defined By | ||
---|---|---|---|
disposed : Boolean [read-only]
Determines whether this instance has been disposed. | CompoundUndoUnit | ||
length : int [read-only]
The number of units that are contained in this compound unit. | CompoundUndoUnit | ||
redoName : String
Returns the name of the redo unit. | CompoundUndoUnit | ||
undoName : String
The name of the undo unit. | CompoundUndoUnit |
Method | Defined By | ||
---|---|---|---|
CompoundUndoUnit(undoName:String = null, redoName:String = null)
Creates a new instance using the provided names. | CompoundUndoUnit | ||
addToQueue(unit:IUndoUnit):void
Adds a new IUndoUnit to the queue. | CompoundUndoUnit | ||
This implementation will always yield false. | CompoundUndoUnit | ||
canRedo():Boolean
Determines whether this instance can currently redo its work. | CompoundUndoUnit | ||
canUndo():Boolean
Determines whether this instance can currently undo its work. | CompoundUndoUnit | ||
clear():void
Clears the internal collection of units. | CompoundUndoUnit | ||
dispose():void
Disposes this unit and all of its contents. | CompoundUndoUnit | ||
redo():void
Redoes the next IUndoUnit. | CompoundUndoUnit | ||
removeUnit(unit:IUndoUnit):Boolean
Tries to remove a given unit from this compound unit. | CompoundUndoUnit | ||
replaceUnit(unit:IUndoUnit):Boolean
This implementation will always yield false. | CompoundUndoUnit | ||
toString():String | CompoundUndoUnit | ||
undo():void
Undoes the next IUndoUnit. | CompoundUndoUnit |
disposed | property |
disposed:Boolean
[read-only] Determines whether this instance has been disposed.
An instance that has been disposed cannot used anymore.
public function get disposed():Boolean
length | property |
length:int
[read-only] The number of units that are contained in this compound unit.
public function get length():int
redoName | property |
redoName:String
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
public function set redoName(value:String):void
undoName | property |
undoName:String
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
public function set undoName(value:String):void
CompoundUndoUnit | () | Constructor |
public function CompoundUndoUnit(undoName:String = null, redoName:String = null)
Creates a new instance using the provided names.
ParametersundoName:String (default = null ) — The name for the undo operation.
| |
redoName:String (default = null ) — The name for the redo operation.
|
addToQueue | () | method |
public function addToQueue(unit:IUndoUnit):void
Adds a new IUndoUnit
to the queue.
Parameters
unit:IUndoUnit — The unit of work to add.
|
addUnit | () | method |
public function addUnit(unit:IUndoUnit):Boolean
This implementation will always yield 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.
|
clear | () | method |
public function clear():void
Clears the internal collection of units.
dispose | () | method |
public function dispose():void
Disposes this unit and all of its contents.
This unit cannot be used anymore after this has been invoked.
redo | () | method |
public function redo():void
Redoes the next IUndoUnit
.
IllegalOperationError — If an undo uperation is already in progress.
|
removeUnit | () | method |
public function removeUnit(unit:IUndoUnit):Boolean
Tries to remove a given unit from this compound unit.
This method will throw an error if this unit has been undone or an undo or redo is in progress or this unit has already been disposed. This method will not automatically dispose removed units.
Parameters
unit:IUndoUnit — The unit to remove.
|
Boolean — true if the unit has been removed from this instance.
|
replaceUnit | () | method |
public function replaceUnit(unit:IUndoUnit):Boolean
This implementation will always yield 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.
|
toString | () | method |
public function toString():String
Returns
String |
undo | () | method |
public function undo():void
Undoes the next IUndoUnit
.
IllegalOperationError — If an undo uperation is already in progress.
|