@Test public void testGraphCommandUndo() { final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler); assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce)); assertEquals(GraphCommandResultBuilder.SUCCESS, c.undo(gce)); assertEquals(OLD_PARAMETER_TYPE_REF, parameter.getTypeRef()); }
@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) { parameter.setTypeRef(typeRef); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { parameter.setTypeRef(oldTypeRef); return GraphCommandResultBuilder.SUCCESS; } }; }
UpdateParameterTypeRefCommand 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) { parameter.setTypeRef(typeRef); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { parameter.setTypeRef(oldTypeRef); return GraphCommandResultBuilder.SUCCESS; } }; } }
UpdateParameterTypeRefCommand 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) { parameter.setTypeRef(typeRef); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { parameter.setTypeRef(oldTypeRef); return GraphCommandResultBuilder.SUCCESS; } }; } UpdateParameterTypeRefCommand(final InformationItem parameter,
                                         final QName typeRef,
                                         final org.uberfire.mvp.Command canvasOperation); }
UpdateParameterTypeRefCommand 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) { parameter.setTypeRef(typeRef); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { parameter.setTypeRef(oldTypeRef); return GraphCommandResultBuilder.SUCCESS; } }; } UpdateParameterTypeRefCommand(final InformationItem parameter,
                                         final QName typeRef,
                                         final org.uberfire.mvp.Command canvasOperation);  }
UpdateParameterTypeRefCommand 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) { parameter.setTypeRef(typeRef); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { parameter.setTypeRef(oldTypeRef); return GraphCommandResultBuilder.SUCCESS; } }; } UpdateParameterTypeRefCommand(final InformationItem parameter,
                                         final QName typeRef,
                                         final org.uberfire.mvp.Command canvasOperation);   }