@Test public void testGraphCommandExecuteInsertBelow() { final DecisionRule existingRule = new DecisionRule(); dtable.getRule().add(existingRule); makeCommand(1); final Command<GraphCommandExecutionContext, RuleViolation> graphCommand = command.newGraphCommand(canvasHandler); graphCommand.execute(graphCommandExecutionContext); assertEquals(2, dtable.getRule().size()); assertEquals(existingRule, dtable.getRule().get(0)); assertEquals(rule, dtable.getRule().get(1)); }
@Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler context) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { dtable.getRule().add(uiRowIndex, rule); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { dtable.getRule().remove(rule); return GraphCommandResultBuilder.SUCCESS; } }; }
AddDecisionRuleCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                  VetoUndoCommand { @Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler context) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { dtable.getRule().add(uiRowIndex, rule); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { dtable.getRule().remove(rule); return GraphCommandResultBuilder.SUCCESS; } }; } }
AddDecisionRuleCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                  VetoUndoCommand { @Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler context) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { dtable.getRule().add(uiRowIndex, rule); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { dtable.getRule().remove(rule); return GraphCommandResultBuilder.SUCCESS; } }; } AddDecisionRuleCommand(final DecisionTable dtable,
                                  final DecisionRule rule,
                                  final GridData uiModel,
                                  final GridRow uiModelRow,
                                  final int uiRowIndex,
                                  final DecisionTableUIModelMapper uiModelMapper,
                                  final org.uberfire.mvp.Command canvasOperation); }
AddDecisionRuleCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                  VetoUndoCommand { @Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler context) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { dtable.getRule().add(uiRowIndex, rule); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { dtable.getRule().remove(rule); return GraphCommandResultBuilder.SUCCESS; } }; } AddDecisionRuleCommand(final DecisionTable dtable,
                                  final DecisionRule rule,
                                  final GridData uiModel,
                                  final GridRow uiModelRow,
                                  final int uiRowIndex,
                                  final DecisionTableUIModelMapper uiModelMapper,
                                  final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation(); }
AddDecisionRuleCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                  VetoUndoCommand { @Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler context) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { dtable.getRule().add(uiRowIndex, rule); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { dtable.getRule().remove(rule); return GraphCommandResultBuilder.SUCCESS; } }; } AddDecisionRuleCommand(final DecisionTable dtable,
                                  final DecisionRule rule,
                                  final GridData uiModel,
                                  final GridRow uiModelRow,
                                  final int uiRowIndex,
                                  final DecisionTableUIModelMapper uiModelMapper,
                                  final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation();  }