@Test public void testGraphCommandUndo() { makeCommand(0); final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler); assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce)); assertEquals(GraphCommandResultBuilder.SUCCESS, c.undo(gce)); assertEquals(1, invocation.getBinding().size()); assertEquals(binding, invocation.getBinding().get(0)); }
@Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler handler) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext gce) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext gce) { invocation.getBinding().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { invocation.getBinding().add(uiRowIndex, oldParameterBinding); return GraphCommandResultBuilder.SUCCESS; } }; }
DeleteParameterBindingCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                         VetoUndoCommand { @Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler handler) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext gce) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext gce) { invocation.getBinding().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { invocation.getBinding().add(uiRowIndex, oldParameterBinding); return GraphCommandResultBuilder.SUCCESS; } }; } }
DeleteParameterBindingCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                         VetoUndoCommand { @Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler handler) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext gce) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext gce) { invocation.getBinding().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { invocation.getBinding().add(uiRowIndex, oldParameterBinding); return GraphCommandResultBuilder.SUCCESS; } }; } DeleteParameterBindingCommand(final Invocation invocation,
                                         final GridData uiModel,
                                         final int uiRowIndex,
                                         final org.uberfire.mvp.Command canvasOperation); }
DeleteParameterBindingCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                         VetoUndoCommand { @Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler handler) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext gce) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext gce) { invocation.getBinding().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { invocation.getBinding().add(uiRowIndex, oldParameterBinding); return GraphCommandResultBuilder.SUCCESS; } }; } DeleteParameterBindingCommand(final Invocation invocation,
                                         final GridData uiModel,
                                         final int uiRowIndex,
                                         final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation(); }
DeleteParameterBindingCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                         VetoUndoCommand { @Override protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler handler) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext gce) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext gce) { invocation.getBinding().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { invocation.getBinding().add(uiRowIndex, oldParameterBinding); return GraphCommandResultBuilder.SUCCESS; } }; } DeleteParameterBindingCommand(final Invocation invocation,
                                         final GridData uiModel,
                                         final int uiRowIndex,
                                         final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation();  }