public class AddItemCommand<T> extends Command
| Constructor and Description |
|---|
AddItemCommand(Workbook workbook,
UndoableCollection<T> collection,
int index,
T item)
Initializes a new instance of the
AddItemCommand 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 AddItemCommand(Workbook workbook, UndoableCollection<T> collection, int index, T item)
AddItemCommand class.workbook - The Workbook modified by this command.collection - The collection to which the new item is added.index - The zero-based index where the new collection should be added.item - The item that should be added to the collection.