@Test public void testGraphCommandExecuteWithNoColumns() { final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler); assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce)); assertEquals(0, relation.getRow().size()); }
@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) { relation.getRow().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { relation.getRow().add(uiRowIndex, oldRow); return GraphCommandResultBuilder.SUCCESS; } }; }
DeleteRelationRowCommand 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) { relation.getRow().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { relation.getRow().add(uiRowIndex, oldRow); return GraphCommandResultBuilder.SUCCESS; } }; } }
DeleteRelationRowCommand 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) { relation.getRow().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { relation.getRow().add(uiRowIndex, oldRow); return GraphCommandResultBuilder.SUCCESS; } }; } DeleteRelationRowCommand(final Relation relation,
                                    final GridData uiModel,
                                    final int uiRowIndex,
                                    final org.uberfire.mvp.Command canvasOperation); }
DeleteRelationRowCommand 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) { relation.getRow().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { relation.getRow().add(uiRowIndex, oldRow); return GraphCommandResultBuilder.SUCCESS; } }; } DeleteRelationRowCommand(final Relation relation,
                                    final GridData uiModel,
                                    final int uiRowIndex,
                                    final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation(); }
DeleteRelationRowCommand 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) { relation.getRow().remove(uiRowIndex); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { relation.getRow().add(uiRowIndex, oldRow); return GraphCommandResultBuilder.SUCCESS; } }; } DeleteRelationRowCommand(final Relation relation,
                                    final GridData uiModel,
                                    final int uiRowIndex,
                                    final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation();  }