DefaultGridWidgetCellSelectorMouseEventHandler implements NodeMouseEventHandler { @Override public boolean onNodeMouseEvent(final GridWidget gridWidget, final Point2D relativeLocation, final Optional<Integer> uiHeaderRowIndex, final Optional<Integer> uiHeaderColumnIndex, final Optional<Integer> uiRowIndex, final Optional<Integer> uiColumnIndex, final AbstractNodeMouseEvent event) { if (isDNDOperationInProgress(gridWidget)) { return false; } boolean isHandled = false; if (uiHeaderRowIndex.isPresent() && uiHeaderColumnIndex.isPresent()) { isHandled = handleHeaderCell(gridWidget, relativeLocation, uiHeaderRowIndex.get(), uiHeaderColumnIndex.get(), event); } if (!isHandled && uiRowIndex.isPresent() && uiColumnIndex.isPresent()) { isHandled = handleBodyCell(gridWidget, relativeLocation, uiRowIndex.get(), uiColumnIndex.get(), event); } if (isHandled) { if (!gridWidget.isSelected()) { selectionManager.select(gridWidget); } } return isHandled; } DefaultGridWidgetCellSelectorMouseEventHandler(final GridSelectionManager selectionManager); @Override boolean onNodeMouseEvent(final GridWidget gridWidget,
                                    final Point2D relativeLocation,
                                    final Optional<Integer> uiHeaderRowIndex,
                                    final Optional<Integer> uiHeaderColumnIndex,
                                    final Optional<Integer> uiRowIndex,
                                    final Optional<Integer> uiColumnIndex,
                                    final AbstractNodeMouseEvent event); @Override boolean handleHeaderCell(final GridWidget gridWidget,
                                    final Point2D relativeLocation,
                                    final int uiHeaderRowIndex,
                                    final int uiHeaderColumnIndex,
                                    final AbstractNodeMouseEvent event); @Override boolean handleBodyCell(final GridWidget gridWidget,
                                  final Point2D relativeLocation,
                                  final int uiRowIndex,
                                  final int uiColumnIndex,
                                  final AbstractNodeMouseEvent event);  }
@Test public void checkOnNodeMouseEventDuringDragOperation() { doReturn(true).when(handler).isDNDOperationInProgress(eq(gridWidget)); assertFalse(handler.onNodeMouseEvent(gridWidget, relativeLocation, Optional.empty(), Optional.empty(), Optional.of(0), Optional.of(1), event)); }