@Test public void testCanvasCommandAllow() { makeCommand(); final Command<AbstractCanvasHandler, CanvasViolation> c = command.newCanvasCommand(handler); assertEquals(CanvasCommandResultBuilder.SUCCESS, c.allow(handler)); }
@Override protected Command<AbstractCanvasHandler, CanvasViolation> newCanvasCommand(final AbstractCanvasHandler handler) { return new AbstractCanvasCommand() { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler handler) { uiModel.insertRow(uiRowIndex, uiModelRow); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.ROW_NUMBER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_EXPRESSION_COLUMN_INDEX); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } @Override public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler handler) { final int rowIndex = uiModel.getRows().indexOf(uiModelRow); uiModel.deleteRow(rowIndex); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } }; }
AddParameterBindingCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                      VetoUndoCommand { @Override protected Command<AbstractCanvasHandler, CanvasViolation> newCanvasCommand(final AbstractCanvasHandler handler) { return new AbstractCanvasCommand() { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler handler) { uiModel.insertRow(uiRowIndex, uiModelRow); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.ROW_NUMBER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_EXPRESSION_COLUMN_INDEX); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } @Override public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler handler) { final int rowIndex = uiModel.getRows().indexOf(uiModelRow); uiModel.deleteRow(rowIndex); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } }; } }
AddParameterBindingCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                      VetoUndoCommand { @Override protected Command<AbstractCanvasHandler, CanvasViolation> newCanvasCommand(final AbstractCanvasHandler handler) { return new AbstractCanvasCommand() { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler handler) { uiModel.insertRow(uiRowIndex, uiModelRow); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.ROW_NUMBER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_EXPRESSION_COLUMN_INDEX); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } @Override public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler handler) { final int rowIndex = uiModel.getRows().indexOf(uiModelRow); uiModel.deleteRow(rowIndex); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } }; } AddParameterBindingCommand(final Invocation invocation,
                                      final Binding binding,
                                      final GridData uiModel,
                                      final GridRow uiModelRow,
                                      final int uiRowIndex,
                                      final InvocationUIModelMapper uiModelMapper,
                                      final org.uberfire.mvp.Command canvasOperation); }
AddParameterBindingCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                      VetoUndoCommand { @Override protected Command<AbstractCanvasHandler, CanvasViolation> newCanvasCommand(final AbstractCanvasHandler handler) { return new AbstractCanvasCommand() { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler handler) { uiModel.insertRow(uiRowIndex, uiModelRow); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.ROW_NUMBER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_EXPRESSION_COLUMN_INDEX); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } @Override public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler handler) { final int rowIndex = uiModel.getRows().indexOf(uiModelRow); uiModel.deleteRow(rowIndex); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } }; } AddParameterBindingCommand(final Invocation invocation,
                                      final Binding binding,
                                      final GridData uiModel,
                                      final GridRow uiModelRow,
                                      final int uiRowIndex,
                                      final InvocationUIModelMapper uiModelMapper,
                                      final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation(); }
AddParameterBindingCommand extends AbstractCanvasGraphCommand implements VetoExecutionCommand,
                                                                                      VetoUndoCommand { @Override protected Command<AbstractCanvasHandler, CanvasViolation> newCanvasCommand(final AbstractCanvasHandler handler) { return new AbstractCanvasCommand() { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler handler) { uiModel.insertRow(uiRowIndex, uiModelRow); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.ROW_NUMBER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_PARAMETER_COLUMN_INDEX); uiModelMapper.fromDMNModel(uiRowIndex, InvocationUIModelMapper.BINDING_EXPRESSION_COLUMN_INDEX); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } @Override public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler handler) { final int rowIndex = uiModel.getRows().indexOf(uiModelRow); uiModel.deleteRow(rowIndex); updateRowNumbers(); updateParentInformation(); canvasOperation.execute(); return CanvasCommandResultBuilder.SUCCESS; } }; } AddParameterBindingCommand(final Invocation invocation,
                                      final Binding binding,
                                      final GridData uiModel,
                                      final GridRow uiModelRow,
                                      final int uiRowIndex,
                                      final InvocationUIModelMapper uiModelMapper,
                                      final org.uberfire.mvp.Command canvasOperation); void updateRowNumbers(); void updateParentInformation();  }