@Test public void testGraphCommandAllow() { makeCommand(OLD_HIT_POLICY); 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) { dtable.setHitPolicy(hitPolicy); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { dtable.setHitPolicy(oldHitPolicy.orElse(HitPolicy.UNIQUE)); return GraphCommandResultBuilder.SUCCESS; } }; }
SetHitPolicyCommand 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) { dtable.setHitPolicy(hitPolicy); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { dtable.setHitPolicy(oldHitPolicy.orElse(HitPolicy.UNIQUE)); return GraphCommandResultBuilder.SUCCESS; } }; } }
SetHitPolicyCommand 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) { dtable.setHitPolicy(hitPolicy); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { dtable.setHitPolicy(oldHitPolicy.orElse(HitPolicy.UNIQUE)); return GraphCommandResultBuilder.SUCCESS; } }; } SetHitPolicyCommand(final DecisionTable dtable,
                               final HitPolicy hitPolicy,
                               final org.uberfire.mvp.Command canvasOperation); }
SetHitPolicyCommand 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) { dtable.setHitPolicy(hitPolicy); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { dtable.setHitPolicy(oldHitPolicy.orElse(HitPolicy.UNIQUE)); return GraphCommandResultBuilder.SUCCESS; } }; } SetHitPolicyCommand(final DecisionTable dtable,
                               final HitPolicy hitPolicy,
                               final org.uberfire.mvp.Command canvasOperation);  }
SetHitPolicyCommand 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) { dtable.setHitPolicy(hitPolicy); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext gce) { dtable.setHitPolicy(oldHitPolicy.orElse(HitPolicy.UNIQUE)); return GraphCommandResultBuilder.SUCCESS; } }; } SetHitPolicyCommand(final DecisionTable dtable,
                               final HitPolicy hitPolicy,
                               final org.uberfire.mvp.Command canvasOperation);   }