public class ReplaceItemCommand<T> extends Command
| Constructor and Description |
|---|
ReplaceItemCommand(Workbook workbook,
UndoableCollection<T> collection,
int index,
T item,
T newItem)
Initializes a new instance of the
ReplaceItemCommand class. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
execute()
Carries out an action that changes the workbook in some way.
|
protected void |
redo()
Repeats an action that has been undone.
|
protected void |
undo()
Undoes an action, restoring the workbook to the state it was in before carrying out the action.
|
getHasEffect, getWorkbookpublic ReplaceItemCommand(Workbook workbook, UndoableCollection<T> collection, int index, T item, T newItem)
ReplaceItemCommand class.workbook - The Workbook modified by this command.collection - The collection in which the item is replaced.index - The zero-based index of the item within the collection.item - The item that should be replaced in the collection.newItem - The new item at the specified index.