Class UpdateSettingsDataCommand
- java.lang.Object
-
- org.kie.workbench.common.command.client.AbstractCommand<ScenarioSimulationContext,ScenarioSimulationViolation>
-
- org.drools.workbench.screens.scenariosimulation.client.commands.actualcommands.AbstractScenarioSimulationCommand
-
- org.drools.workbench.screens.scenariosimulation.client.commands.actualcommands.AbstractScenarioSimulationUndoableCommand<org.drools.scenariosimulation.api.model.Settings>
-
- org.drools.workbench.screens.scenariosimulation.client.commands.actualcommands.UpdateSettingsDataCommand
-
- All Implemented Interfaces:
org.kie.workbench.common.command.client.Command<ScenarioSimulationContext,ScenarioSimulationViolation>
public class UpdateSettingsDataCommand extends AbstractScenarioSimulationUndoableCommand<org.drools.scenariosimulation.api.model.Settings>
Command which manages every changes applied to the SettingsDock.
-
-
Field Summary
-
Fields inherited from class org.drools.workbench.screens.scenariosimulation.client.commands.actualcommands.AbstractScenarioSimulationUndoableCommand
restorableStatus
-
-
Constructor Summary
Constructors Constructor Description UpdateSettingsDataCommand(Consumer<org.drools.scenariosimulation.api.model.Settings> settingsConsumer, boolean dmnPathChanged)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected voidinternalExecute(ScenarioSimulationContext context)protected 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 org.drools.scenariosimulation.api.model.SettingssetRestorableStatusPreExecution(ScenarioSimulationContext context)It sets the status BEFORE the command is launched.-
Methods inherited from class org.drools.workbench.screens.scenariosimulation.client.commands.actualcommands.AbstractScenarioSimulationUndoableCommand
execute, redo, undo
-
Methods inherited from class org.drools.workbench.screens.scenariosimulation.client.commands.actualcommands.AbstractScenarioSimulationCommand
commonExecution, getId
-
-
-
-
Constructor Detail
-
UpdateSettingsDataCommand
public UpdateSettingsDataCommand(Consumer<org.drools.scenariosimulation.api.model.Settings> settingsConsumer, boolean dmnPathChanged)
-
-
Method Detail
-
setRestorableStatusPreExecution
protected org.drools.scenariosimulation.api.model.Settings setRestorableStatusPreExecution(ScenarioSimulationContext context)
Description copied from class:AbstractScenarioSimulationUndoableCommandIt sets the status BEFORE the command is launched. Typically it clones the current status before changes are applied.- Specified by:
setRestorableStatusPreExecutionin classAbstractScenarioSimulationUndoableCommand<org.drools.scenariosimulation.api.model.Settings>- Returns:
-
commonUndoRedoPreExecution
public Optional<org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation>> commonUndoRedoPreExecution(ScenarioSimulationContext context)
Description copied from class:AbstractScenarioSimulationUndoableCommandMethod called soon before actual undo and redo operations to preliminary execute a tab switch without altering the call stack. (eg If the command change the status of a not shown grid, this switches the tab)- Specified by:
commonUndoRedoPreExecutionin classAbstractScenarioSimulationUndoableCommand<org.drools.scenariosimulation.api.model.Settings>- Returns:
Optional<CommandResult<ScenarioSimulationViolation>>ofCommandResultBuilder.SUCCESSif a tab switch happened, otherwiseOptional.empty()
-
setCurrentContext
protected org.kie.workbench.common.command.client.CommandResult<ScenarioSimulationViolation> setCurrentContext(ScenarioSimulationContext context)
Description copied from class:AbstractScenarioSimulationUndoableCommandThe action to perform when an UNDO or REDO is required on this command. Typically it restores the previous status and it stores the current one.- Specified by:
setCurrentContextin classAbstractScenarioSimulationUndoableCommand<org.drools.scenariosimulation.api.model.Settings>- Returns:
-
internalExecute
protected void internalExecute(ScenarioSimulationContext context)
- Specified by:
internalExecutein classAbstractScenarioSimulationCommand
-
-