Class ScenarioCommandRegistryManager
- java.lang.Object
-
- org.kie.workbench.common.command.client.registry.AbstractCommandRegistryManager<AbstractScenarioSimulationUndoableCommand>
-
- org.drools.workbench.screens.scenariosimulation.client.commands.ScenarioCommandRegistryManager
-
@Dependent public class ScenarioCommandRegistryManager extends org.kie.workbench.common.command.client.registry.AbstractCommandRegistryManager<AbstractScenarioSimulationUndoableCommand>
This class is used to storeQueuees of executed/undoneCommands
-
-
Constructor Summary
Constructors Constructor Description ScenarioCommandRegistryManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation>commonUndoRedoOperation(ScenarioSimulationContext scenarioSimulationContext, AbstractScenarioSimulationUndoableCommand command, boolean isUndo)Common method called by undo and redo eventsprotected Optional<org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation>>commonUndoRedoPreexecution(ScenarioSimulationContext scenarioSimulationContext, AbstractScenarioSimulationUndoableCommand command)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>redo(ScenarioSimulationContext scenarioSimulationContext)Re-execute the last undoneCommandvoidregister(ScenarioSimulationContext context, AbstractScenarioSimulationUndoableCommand command)Method to register the status as it was soon before the command execution, to be used for undo/redoprotected voidsetUndoRedoButtonStatus(ScenarioSimulationContext scenarioSimulationContext)org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation>undo(ScenarioSimulationContext scenarioSimulationContext)Calls undo on the last executedCommand
-
-
-
Method Detail
-
register
public void register(ScenarioSimulationContext context, AbstractScenarioSimulationUndoableCommand command)
Method to register the status as it was soon before the command execution, to be used for undo/redo- Parameters:
context-command-
-
undo
public org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext scenarioSimulationContext)
Calls undo on the last executedCommand- Parameters:
scenarioSimulationContext-- Throws:
NoSuchElementException
-
redo
public org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext scenarioSimulationContext)
Re-execute the last undoneCommand- Parameters:
scenarioSimulationContext-- Throws:
NoSuchElementException
-
commonUndoRedoPreexecution
protected Optional<org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation>> commonUndoRedoPreexecution(ScenarioSimulationContext scenarioSimulationContext, AbstractScenarioSimulationUndoableCommand command)
Method called soon before actual undo and redo operations to preliminary execute a tab switch without altering the call stack. If the command change the status of a not shown grid, this switches the tab and returns without removing now executing the actual command.- Parameters:
scenarioSimulationContext-command-
-
commonUndoRedoOperation
protected org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> commonUndoRedoOperation(ScenarioSimulationContext scenarioSimulationContext, AbstractScenarioSimulationUndoableCommand command, boolean isUndo)
Common method called by undo and redo events- Parameters:
scenarioSimulationContext-command-isUndo-- Returns:
-
setUndoRedoButtonStatus
protected void setUndoRedoButtonStatus(ScenarioSimulationContext scenarioSimulationContext)
-
-