@Test public void testMoveRowsToNotPermitted() { doReturn(GraphCommandResultBuilder.failed()).when(sessionCommandManager).allow(eq(canvasHandler), any(MoveRowsCommand.class)); uiModel.moveRowsTo(0, Collections.singletonList(gridRow)); verify(sessionCommandManager, never()).execute(any(AbstractCanvasHandler.class), any(MoveRowsCommand.class)); }
@Override public void moveRowsTo(final int index, final List<GridRow> rows) { expression.get().ifPresent(context -> { final AbstractCanvasHandler handler = (AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(); final MoveRowsCommand command = new MoveRowsCommand(context, delegate, index, rows, canvasOperation); if (isAllowed(sessionCommandManager.allow(handler, command))) { sessionCommandManager.execute(handler, command); } }); }
ContextGridData extends DelegatingGridData { @Override public void moveRowsTo(final int index, final List<GridRow> rows) { expression.get().ifPresent(context -> { final AbstractCanvasHandler handler = (AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(); final MoveRowsCommand command = new MoveRowsCommand(context, delegate, index, rows, canvasOperation); if (isAllowed(sessionCommandManager.allow(handler, command))) { sessionCommandManager.execute(handler, command); } }); } }
ContextGridData extends DelegatingGridData { @Override public void moveRowsTo(final int index, final List<GridRow> rows) { expression.get().ifPresent(context -> { final AbstractCanvasHandler handler = (AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(); final MoveRowsCommand command = new MoveRowsCommand(context, delegate, index, rows, canvasOperation); if (isAllowed(sessionCommandManager.allow(handler, command))) { sessionCommandManager.execute(handler, command); } }); } ContextGridData(final DMNGridData delegate,
                           final SessionManager sessionManager,
                           final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                           final Supplier<Optional<Context>> expression,
                           final Command canvasOperation); }
ContextGridData extends DelegatingGridData { @Override public void moveRowsTo(final int index, final List<GridRow> rows) { expression.get().ifPresent(context -> { final AbstractCanvasHandler handler = (AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(); final MoveRowsCommand command = new MoveRowsCommand(context, delegate, index, rows, canvasOperation); if (isAllowed(sessionCommandManager.allow(handler, command))) { sessionCommandManager.execute(handler, command); } }); } ContextGridData(final DMNGridData delegate,
                           final SessionManager sessionManager,
                           final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                           final Supplier<Optional<Context>> expression,
                           final Command canvasOperation); @Override void moveRowTo(final int index,
                          final GridRow row); @Override void moveRowsTo(final int index,
                           final List<GridRow> rows); }
ContextGridData extends DelegatingGridData { @Override public void moveRowsTo(final int index, final List<GridRow> rows) { expression.get().ifPresent(context -> { final AbstractCanvasHandler handler = (AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(); final MoveRowsCommand command = new MoveRowsCommand(context, delegate, index, rows, canvasOperation); if (isAllowed(sessionCommandManager.allow(handler, command))) { sessionCommandManager.execute(handler, command); } }); } ContextGridData(final DMNGridData delegate,
                           final SessionManager sessionManager,
                           final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                           final Supplier<Optional<Context>> expression,
                           final Command canvasOperation); @Override void moveRowTo(final int index,
                          final GridRow row); @Override void moveRowsTo(final int index,
                           final List<GridRow> rows);  }