@Test public void show_Simulation_NotNullRunScenarioElement() { super.show(businessCentralGridContextMenuSpy, GridWidget.SIMULATION, ScenarioSimulationEditorConstants.INSTANCE.scenario(), "scenario", 0, 0, 1); verify(businessCentralGridContextMenuSpy, never()).addExecutableMenuItem(eq(GRIDCONTEXTMENU_RUN_SINGLE_SCENARIO), eq(ScenarioSimulationEditorConstants.INSTANCE.runSingleScenario()), eq("runSingleScenario")); verify(businessCentralGridContextMenuSpy, times(1)).mapEvent(eq(runSingleScenarioElementMock), isA(RunSingleScenarioEvent.class)); }
@Override public void show(GridWidget gridWidget, int mx, int my, int rowIndex) { super.show(gridWidget, mx, my, rowIndex); if (Objects.equals(GridWidget.BACKGROUND, gridWidget) && runSingleScenarioElement != null) { removeMenuItem(runSingleScenarioElement); runSingleScenarioElement = null; } else if (Objects.equals(GridWidget.SIMULATION, gridWidget)) { if (runSingleScenarioElement == null) { runSingleScenarioElement = addExecutableMenuItem(GRIDCONTEXTMENU_RUN_SINGLE_SCENARIO, constants.runSingleScenario(), "runSingleScenario"); } mapEvent(runSingleScenarioElement, new RunSingleScenarioEvent(rowIndex)); } }
BusinessCentralGridContextMenu extends GridContextMenu { @Override public void show(GridWidget gridWidget, int mx, int my, int rowIndex) { super.show(gridWidget, mx, my, rowIndex); if (Objects.equals(GridWidget.BACKGROUND, gridWidget) && runSingleScenarioElement != null) { removeMenuItem(runSingleScenarioElement); runSingleScenarioElement = null; } else if (Objects.equals(GridWidget.SIMULATION, gridWidget)) { if (runSingleScenarioElement == null) { runSingleScenarioElement = addExecutableMenuItem(GRIDCONTEXTMENU_RUN_SINGLE_SCENARIO, constants.runSingleScenario(), "runSingleScenario"); } mapEvent(runSingleScenarioElement, new RunSingleScenarioEvent(rowIndex)); } } }
BusinessCentralGridContextMenu extends GridContextMenu { @Override public void show(GridWidget gridWidget, int mx, int my, int rowIndex) { super.show(gridWidget, mx, my, rowIndex); if (Objects.equals(GridWidget.BACKGROUND, gridWidget) && runSingleScenarioElement != null) { removeMenuItem(runSingleScenarioElement); runSingleScenarioElement = null; } else if (Objects.equals(GridWidget.SIMULATION, gridWidget)) { if (runSingleScenarioElement == null) { runSingleScenarioElement = addExecutableMenuItem(GRIDCONTEXTMENU_RUN_SINGLE_SCENARIO, constants.runSingleScenario(), "runSingleScenario"); } mapEvent(runSingleScenarioElement, new RunSingleScenarioEvent(rowIndex)); } }  }
BusinessCentralGridContextMenu extends GridContextMenu { @Override public void show(GridWidget gridWidget, int mx, int my, int rowIndex) { super.show(gridWidget, mx, my, rowIndex); if (Objects.equals(GridWidget.BACKGROUND, gridWidget) && runSingleScenarioElement != null) { removeMenuItem(runSingleScenarioElement); runSingleScenarioElement = null; } else if (Objects.equals(GridWidget.SIMULATION, gridWidget)) { if (runSingleScenarioElement == null) { runSingleScenarioElement = addExecutableMenuItem(GRIDCONTEXTMENU_RUN_SINGLE_SCENARIO, constants.runSingleScenario(), "runSingleScenario"); } mapEvent(runSingleScenarioElement, new RunSingleScenarioEvent(rowIndex)); } }  @PostConstruct @Override void initMenu(); @Override void show(GridWidget gridWidget, int mx, int my, int rowIndex); }
BusinessCentralGridContextMenu extends GridContextMenu { @Override public void show(GridWidget gridWidget, int mx, int my, int rowIndex) { super.show(gridWidget, mx, my, rowIndex); if (Objects.equals(GridWidget.BACKGROUND, gridWidget) && runSingleScenarioElement != null) { removeMenuItem(runSingleScenarioElement); runSingleScenarioElement = null; } else if (Objects.equals(GridWidget.SIMULATION, gridWidget)) { if (runSingleScenarioElement == null) { runSingleScenarioElement = addExecutableMenuItem(GRIDCONTEXTMENU_RUN_SINGLE_SCENARIO, constants.runSingleScenario(), "runSingleScenario"); } mapEvent(runSingleScenarioElement, new RunSingleScenarioEvent(rowIndex)); } }  @PostConstruct @Override void initMenu(); @Override void show(GridWidget gridWidget, int mx, int my, int rowIndex);  }