@Test public void testOnNodeMouseEventWhenNestedOnHeader() { setupGrid(() -> parent, () -> 1); uiHeaderRowIndex = Optional.of(0); uiHeaderColumnIndex = Optional.of(1); uiRowIndex = Optional.empty(); uiColumnIndex = Optional.empty(); assertThat(handler.onNodeMouseEvent(gridWidget, relativeLocation, uiHeaderRowIndex, uiHeaderColumnIndex, uiRowIndex, uiColumnIndex, event)).isFalse(); }
@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 (nestingSupplier.get() == 0) { return doSuperOnNodeMouseEvent(gridWidget, relativeLocation, uiHeaderRowIndex, uiHeaderColumnIndex, uiRowIndex, uiColumnIndex, event); } boolean isHandled = false; if (uiRowIndex.isPresent() && uiColumnIndex.isPresent()) { isHandled = delegatedHandleBodyCell(gridWidget, uiRowIndex.get(), uiColumnIndex.get(), event); } if (isHandled) { final GridWidget parentGridWidget = parentSupplier.get().getGridWidget(); if (!parentGridWidget.isSelected()) { selectionManager.select(parentGridWidget); } } return isHandled; }
DelegatingGridWidgetCellSelectorMouseEventHandler extends DefaultGridWidgetCellSelectorMouseEventHandler { @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 (nestingSupplier.get() == 0) { return doSuperOnNodeMouseEvent(gridWidget, relativeLocation, uiHeaderRowIndex, uiHeaderColumnIndex, uiRowIndex, uiColumnIndex, event); } boolean isHandled = false; if (uiRowIndex.isPresent() && uiColumnIndex.isPresent()) { isHandled = delegatedHandleBodyCell(gridWidget, uiRowIndex.get(), uiColumnIndex.get(), event); } if (isHandled) { final GridWidget parentGridWidget = parentSupplier.get().getGridWidget(); if (!parentGridWidget.isSelected()) { selectionManager.select(parentGridWidget); } } return isHandled; } }
DelegatingGridWidgetCellSelectorMouseEventHandler extends DefaultGridWidgetCellSelectorMouseEventHandler { @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 (nestingSupplier.get() == 0) { return doSuperOnNodeMouseEvent(gridWidget, relativeLocation, uiHeaderRowIndex, uiHeaderColumnIndex, uiRowIndex, uiColumnIndex, event); } boolean isHandled = false; if (uiRowIndex.isPresent() && uiColumnIndex.isPresent()) { isHandled = delegatedHandleBodyCell(gridWidget, uiRowIndex.get(), uiColumnIndex.get(), event); } if (isHandled) { final GridWidget parentGridWidget = parentSupplier.get().getGridWidget(); if (!parentGridWidget.isSelected()) { selectionManager.select(parentGridWidget); } } return isHandled; } DelegatingGridWidgetCellSelectorMouseEventHandler(final GridSelectionManager selectionManager,
                                                             final Supplier<GridCellTuple> parentSupplier,
                                                             final Supplier<Integer> nestingSupplier); }
DelegatingGridWidgetCellSelectorMouseEventHandler extends DefaultGridWidgetCellSelectorMouseEventHandler { @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 (nestingSupplier.get() == 0) { return doSuperOnNodeMouseEvent(gridWidget, relativeLocation, uiHeaderRowIndex, uiHeaderColumnIndex, uiRowIndex, uiColumnIndex, event); } boolean isHandled = false; if (uiRowIndex.isPresent() && uiColumnIndex.isPresent()) { isHandled = delegatedHandleBodyCell(gridWidget, uiRowIndex.get(), uiColumnIndex.get(), event); } if (isHandled) { final GridWidget parentGridWidget = parentSupplier.get().getGridWidget(); if (!parentGridWidget.isSelected()) { selectionManager.select(parentGridWidget); } } return isHandled; } DelegatingGridWidgetCellSelectorMouseEventHandler(final GridSelectionManager selectionManager,
                                                             final Supplier<GridCellTuple> parentSupplier,
                                                             final Supplier<Integer> nestingSupplier); @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); }
DelegatingGridWidgetCellSelectorMouseEventHandler extends DefaultGridWidgetCellSelectorMouseEventHandler { @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 (nestingSupplier.get() == 0) { return doSuperOnNodeMouseEvent(gridWidget, relativeLocation, uiHeaderRowIndex, uiHeaderColumnIndex, uiRowIndex, uiColumnIndex, event); } boolean isHandled = false; if (uiRowIndex.isPresent() && uiColumnIndex.isPresent()) { isHandled = delegatedHandleBodyCell(gridWidget, uiRowIndex.get(), uiColumnIndex.get(), event); } if (isHandled) { final GridWidget parentGridWidget = parentSupplier.get().getGridWidget(); if (!parentGridWidget.isSelected()) { selectionManager.select(parentGridWidget); } } return isHandled; } DelegatingGridWidgetCellSelectorMouseEventHandler(final GridSelectionManager selectionManager,
                                                             final Supplier<GridCellTuple> parentSupplier,
                                                             final Supplier<Integer> nestingSupplier); @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);  }