S - defines the changing object status during the command executionpublic abstract class AbstractScenarioSimulationUndoableCommand<S> extends AbstractScenarioSimulationCommand
| Modifier and Type | Field and Description |
|---|---|
protected S |
restorableStatus
The
ScenarioSimulationContext.Status to restore when calling undo/redo. |
| Constructor and Description |
|---|
AbstractScenarioSimulationUndoableCommand() |
| Modifier and Type | Method and Description |
|---|---|
abstract Optional<org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation>> |
commonUndoRedoPreExecution(ScenarioSimulationContext context)
Method called soon before actual undo and redo operations to preliminary execute a tab switch without
altering the call stack.
|
org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> |
execute(ScenarioSimulationContext context) |
org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> |
redo(ScenarioSimulationContext context) |
protected abstract org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> |
setCurrentContext(ScenarioSimulationContext context)
The action to perform when an UNDO or REDO is required on this command.
|
protected abstract S |
setRestorableStatusPreExecution(ScenarioSimulationContext context)
It sets the status BEFORE the command is launched.
|
org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> |
undo(ScenarioSimulationContext context) |
commonExecution, getId, internalExecuteprotected S restorableStatus
ScenarioSimulationContext.Status to restore when calling undo/redo.
Needed only for undoable commands.public AbstractScenarioSimulationUndoableCommand()
protected abstract org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> setCurrentContext(ScenarioSimulationContext context)
context - protected abstract S setRestorableStatusPreExecution(ScenarioSimulationContext context)
context - public abstract Optional<org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation>> commonUndoRedoPreExecution(ScenarioSimulationContext context)
context - Optional<CommandResult<ScenarioSimulationViolation>> of CommandResultBuilder.SUCCESS
if a tab switch happened, otherwise Optional.empty()public org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context)
execute in interface org.kie.workbench.common.command.client.Command<ScenarioSimulationContext,ScenarioSimulationViolation>execute in class AbstractScenarioSimulationCommandpublic org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context)
undo in interface org.kie.workbench.common.command.client.Command<ScenarioSimulationContext,ScenarioSimulationViolation>undo in class AbstractScenarioSimulationCommandpublic org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext context)
Copyright © 2001–2021 JBoss by Red Hat. All rights reserved.