| Package | com.yworks.support |
| Interface | public interface IUndoUnit |
| Implementors | AbstractUndoUnit, CompoundUndoUnit, UndoEngine |
This is main interface that implements undoability.
UndoEngine can be used to manage implementations of this interface.
See also
| Property | Defined By | ||
|---|---|---|---|
| redoName : String [read-only]
Returns the name of the redo unit. | IUndoUnit | ||
| undoName : String [read-only]
The name of the undo unit. | IUndoUnit | ||
| Method | Defined By | ||
|---|---|---|---|
Allows for collapsing multiple units into one. | IUndoUnit | ||
canRedo():Boolean
Determines whether this instance can currently redo its work. | IUndoUnit | ||
canUndo():Boolean
Determines whether this instance can currently undo its work. | IUndoUnit | ||
dispose():void
Frees all used resources. | IUndoUnit | ||
redo():void
Redoes the change that is represented by this unit. | IUndoUnit | ||
replaceUnit(unit:IUndoUnit):Boolean
Allows for collapsing multiple units into one. | IUndoUnit | ||
undo():void
Undoes the change that is represented by this unit. | IUndoUnit | ||
| 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| addUnit | () | method |
public function addUnit(unit:IUndoUnit):BooleanAllows 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.disposed.
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():voidFrees all used resources.
| redo | () | method |
public function redo():voidRedoes the change that is represented by this unit.
This method will only succeed if canRedo yields true.
See also
| replaceUnit | () | method |
public function replaceUnit(unit:IUndoUnit):BooleanAllows 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.Disposed.
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():voidUndoes the change that is represented by this unit.
This method will only succeed if canUndo yields true.
See also