@Test public void testEscapeFromNotChildCell() { final Optional<BaseExpressionGrid> oParent = Optional.empty(); final BaseExpressionGrid gridWidget = mock(BaseExpressionGrid.class); when(gridWidget.findParentGrid()).thenReturn(oParent); assertThat(operation.perform(gridWidget, false, false)) .as("No need to redraw") .isFalse(); }
@Override public boolean perform(final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) { final AtomicBoolean needToRedraw = new AtomicBoolean(false); final Optional<BaseExpressionGrid> oParent = ((BaseExpressionGrid) gridWidget).findParentGrid(); oParent.ifPresent(parentWidget -> { gridLayer.select(parentWidget); parentWidget.selectFirstCell(); needToRedraw.set(true); }); return needToRedraw.get(); }
KeyboardOperationEscapeGridCell extends BaseKeyboardOperation { @Override public boolean perform(final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) { final AtomicBoolean needToRedraw = new AtomicBoolean(false); final Optional<BaseExpressionGrid> oParent = ((BaseExpressionGrid) gridWidget).findParentGrid(); oParent.ifPresent(parentWidget -> { gridLayer.select(parentWidget); parentWidget.selectFirstCell(); needToRedraw.set(true); }); return needToRedraw.get(); } }
KeyboardOperationEscapeGridCell extends BaseKeyboardOperation { @Override public boolean perform(final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) { final AtomicBoolean needToRedraw = new AtomicBoolean(false); final Optional<BaseExpressionGrid> oParent = ((BaseExpressionGrid) gridWidget).findParentGrid(); oParent.ifPresent(parentWidget -> { gridLayer.select(parentWidget); parentWidget.selectFirstCell(); needToRedraw.set(true); }); return needToRedraw.get(); } KeyboardOperationEscapeGridCell(final GridLayer gridLayer); }
KeyboardOperationEscapeGridCell extends BaseKeyboardOperation { @Override public boolean perform(final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) { final AtomicBoolean needToRedraw = new AtomicBoolean(false); final Optional<BaseExpressionGrid> oParent = ((BaseExpressionGrid) gridWidget).findParentGrid(); oParent.ifPresent(parentWidget -> { gridLayer.select(parentWidget); parentWidget.selectFirstCell(); needToRedraw.set(true); }); return needToRedraw.get(); } KeyboardOperationEscapeGridCell(final GridLayer gridLayer); @Override int getKeyCode(); @Override boolean isExecutable(final GridWidget gridWidget); @Override boolean perform(final GridWidget gridWidget,
                           final boolean isShiftKeyDown,
                           final boolean isControlKeyDown); }
KeyboardOperationEscapeGridCell extends BaseKeyboardOperation { @Override public boolean perform(final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) { final AtomicBoolean needToRedraw = new AtomicBoolean(false); final Optional<BaseExpressionGrid> oParent = ((BaseExpressionGrid) gridWidget).findParentGrid(); oParent.ifPresent(parentWidget -> { gridLayer.select(parentWidget); parentWidget.selectFirstCell(); needToRedraw.set(true); }); return needToRedraw.get(); } KeyboardOperationEscapeGridCell(final GridLayer gridLayer); @Override int getKeyCode(); @Override boolean isExecutable(final GridWidget gridWidget); @Override boolean perform(final GridWidget gridWidget,
                           final boolean isShiftKeyDown,
                           final boolean isControlKeyDown);  }