@Test @SuppressWarnings("unchecked") public void testContextMenuCellIsNotSelectedCell() { final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable(); final GridData uiModel = dtPresenter.getView().getModel(); final GridColumn uiColumn = new RowNumberColumn(); uiModel.appendColumn(uiColumn); uiModel.appendRow(new BaseGridRow()); uiModel.selectCells(1, 0, 1, 1); when(columnInformation.getColumn()).thenReturn(uiColumn); when(modellerPresenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() { { add(dtPresenter); } }); when(uiModel.getCell(any(Integer.class), any(Integer.class))).thenReturn(uiCell); final ContextMenuHandler handler = contextMenuSupport.getContextMenuHandler(modellerPresenter); handler.onContextMenu(event); verify(cellSelectionStrategy, times(1)).handleSelection(any(GridData.class), eq(0), eq(0), eq(false), eq(false)); verify(rowContextMenu, times(1)).show(any(Integer.class), any(Integer.class)); verify(cellContextMenu, never()).show(any(Integer.class), any(Integer.class)); }
public ContextMenuHandler getContextMenuHandler(final GuidedDecisionTableModellerView.Presenter modellerPresenter) { return new GuidedDecisionTableModellerContextMenuHandler(modellerPresenter, cellContextMenu, rowContextMenu); }
GuidedDecisionTableModellerContextMenuSupport { public ContextMenuHandler getContextMenuHandler(final GuidedDecisionTableModellerView.Presenter modellerPresenter) { return new GuidedDecisionTableModellerContextMenuHandler(modellerPresenter, cellContextMenu, rowContextMenu); } }
GuidedDecisionTableModellerContextMenuSupport { public ContextMenuHandler getContextMenuHandler(final GuidedDecisionTableModellerView.Presenter modellerPresenter) { return new GuidedDecisionTableModellerContextMenuHandler(modellerPresenter, cellContextMenu, rowContextMenu); } @Inject  GuidedDecisionTableModellerContextMenuSupport(final CellContextMenu cellContextMenu,
                                                         final RowContextMenu rowContextMenu); }
GuidedDecisionTableModellerContextMenuSupport { public ContextMenuHandler getContextMenuHandler(final GuidedDecisionTableModellerView.Presenter modellerPresenter) { return new GuidedDecisionTableModellerContextMenuHandler(modellerPresenter, cellContextMenu, rowContextMenu); } @Inject  GuidedDecisionTableModellerContextMenuSupport(final CellContextMenu cellContextMenu,
                                                         final RowContextMenu rowContextMenu); ContextMenuHandler getContextMenuHandler(final GuidedDecisionTableModellerView.Presenter modellerPresenter); MouseDownHandler getContextMenuMouseDownHandler(); }
GuidedDecisionTableModellerContextMenuSupport { public ContextMenuHandler getContextMenuHandler(final GuidedDecisionTableModellerView.Presenter modellerPresenter) { return new GuidedDecisionTableModellerContextMenuHandler(modellerPresenter, cellContextMenu, rowContextMenu); } @Inject  GuidedDecisionTableModellerContextMenuSupport(final CellContextMenu cellContextMenu,
                                                         final RowContextMenu rowContextMenu); ContextMenuHandler getContextMenuHandler(final GuidedDecisionTableModellerView.Presenter modellerPresenter); MouseDownHandler getContextMenuMouseDownHandler();  }