@Test public void testGraphCommandAllow() { makeCommand(); final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler); assertEquals(GraphCommandResultBuilder.SUCCESS, c.allow(gce)); }
@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) { list.getExpression().add(uiRowIndex, hasExpression); hasExpression.asDMNModelInstrumentedBase().setParent(list); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { list.getExpression().remove(uiRowIndex); hasExpression.asDMNModelInstrumentedBase().setParent(null); return GraphCommandResultBuilder.SUCCESS; } }; }
AddListRowCommand 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) { list.getExpression().add(uiRowIndex, hasExpression); hasExpression.asDMNModelInstrumentedBase().setParent(list); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { list.getExpression().remove(uiRowIndex); hasExpression.asDMNModelInstrumentedBase().setParent(null); return GraphCommandResultBuilder.SUCCESS; } }; } }
AddListRowCommand 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) { list.getExpression().add(uiRowIndex, hasExpression); hasExpression.asDMNModelInstrumentedBase().setParent(list); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { list.getExpression().remove(uiRowIndex); hasExpression.asDMNModelInstrumentedBase().setParent(null); return GraphCommandResultBuilder.SUCCESS; } }; } AddListRowCommand(final List list,
                             final HasExpression hasExpression,
                             final GridData uiModel,
                             final GridRow uiModelRow,
                             final int uiRowIndex,
                             final ListUIModelMapper uiModelMapper,
                             final org.uberfire.mvp.Command canvasOperation); }
AddListRowCommand 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) { list.getExpression().add(uiRowIndex, hasExpression); hasExpression.asDMNModelInstrumentedBase().setParent(list); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { list.getExpression().remove(uiRowIndex); hasExpression.asDMNModelInstrumentedBase().setParent(null); return GraphCommandResultBuilder.SUCCESS; } }; } AddListRowCommand(final List list,
                             final HasExpression hasExpression,
                             final GridData uiModel,
                             final GridRow uiModelRow,
                             final int uiRowIndex,
                             final ListUIModelMapper uiModelMapper,
                             final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation(); }
AddListRowCommand 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) { list.getExpression().add(uiRowIndex, hasExpression); hasExpression.asDMNModelInstrumentedBase().setParent(list); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { list.getExpression().remove(uiRowIndex); hasExpression.asDMNModelInstrumentedBase().setParent(null); return GraphCommandResultBuilder.SUCCESS; } }; } AddListRowCommand(final List list,
                             final HasExpression hasExpression,
                             final GridData uiModel,
                             final GridRow uiModelRow,
                             final int uiRowIndex,
                             final ListUIModelMapper uiModelMapper,
                             final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation();  }