T
- The type of the single parameter that is passed to the delegate.public final class ConsumerUndoUnit<T> extends AbstractUndoUnit
IUndoUnit
interface that uses simple delegates for the actual undo and redo
operations.Constructor and Description |
---|
ConsumerUndoUnit(String undoName,
Consumer<T> undoRedo)
Creates a new instance using the provided name and a undo/redo handler as well as the parameters to pass to the
delegates.
|
ConsumerUndoUnit(String undoName,
Consumer<T> undo,
Consumer<T> redo)
Creates a new instance using the provided name and a undo and redo handler as well as the parameters to pass to the
delegates.
|
ConsumerUndoUnit(String undoName,
Consumer<T> undo,
Consumer<T> redo,
T undoParam)
Creates a new instance using the provided name and a undo and redo handler as well as the parameters to pass to the
delegates.
|
ConsumerUndoUnit(String undoName,
Consumer<T> undo,
Consumer<T> redo,
T undoParam,
T redoParam)
Creates a new instance using the provided name and a undo and redo handler as well as the parameters to pass to the
delegates.
|
ConsumerUndoUnit(String undoName,
Consumer<T> undoRedo,
T undoParam)
Creates a new instance using the provided name and a undo/redo handler as well as the parameters to pass to the
delegates.
|
ConsumerUndoUnit(String undoName,
Consumer<T> undoRedo,
T undoParam,
T redoParam)
Creates a new instance using the provided name and a undo/redo handler as well as the parameters to pass to the
delegates.
|
Modifier and Type | Method and Description |
---|---|
void |
redo()
Calls the redo delegate using the redo parameter.
|
void |
undo()
Calls the undo delegate using the undo parameter.
|
dispose, getRedoName, getUndoName, toString, tryMergeUnit, tryReplaceUnit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close
public ConsumerUndoUnit(String undoName, Consumer<T> undoRedo)
undoName
- The name of the undo.undoRedo
- The undo and redo handler delegate.public ConsumerUndoUnit(String undoName, Consumer<T> undo, Consumer<T> redo)
undoName
- The name of the undo.undo
- The undo handler delegate.redo
- The redo handler delegate.public ConsumerUndoUnit(String undoName, Consumer<T> undo, Consumer<T> redo, T undoParam)
undoName
- The name of the undo.undo
- The undo handler delegate.redo
- The redo handler delegate.undoParam
- The undo parameter to pass to the delegate.public ConsumerUndoUnit(String undoName, Consumer<T> undo, Consumer<T> redo, T undoParam, T redoParam)
undoName
- The name of the undo.undo
- The undo handler delegate.redo
- The redo handler delegate.undoParam
- The undo parameter to pass to the delegate.redoParam
- The redo parameter to pass to the delegate.public ConsumerUndoUnit(String undoName, Consumer<T> undoRedo, T undoParam)
undoName
- The name of the undo.undoRedo
- The undo and redo handler delegate.undoParam
- The undo parameter to pass to the delegate.public ConsumerUndoUnit(String undoName, Consumer<T> undoRedo, T undoParam, T redoParam)
undoName
- The name of the undo.undoRedo
- The undo and redo handler delegate.undoParam
- The undo parameter to pass to the delegate.redoParam
- The redo parameter to pass to the delegate.public void redo()
redo
in interface IUndoUnit
redo
in class AbstractUndoUnit
IUndoUnit.getRedoName()
public void undo()
undo
in interface IUndoUnit
undo
in class AbstractUndoUnit
IUndoUnit.getUndoName()