public abstract class DisposableCommand extends Command
A DisposableCommand is automatically committed when disposed
unless it has been already executed or cancelled.
| Modifier | Constructor and Description |
|---|---|
protected |
DisposableCommand(Workbook workbook)
Initializes a new instance of the
DisposableCommand class. |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the command.
|
void |
dispose()
Disposes the command.
|
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, getWorkbookprotected DisposableCommand(Workbook workbook)
DisposableCommand class.workbook - The Workbook modified by this command.public void dispose()
protected boolean execute()
public void cancel()
protected void undo()