ScenarioGrid extends BaseGridWidget { protected void setHeaderColumns(AbstractScesimModel abstractScesimModel, ScenarioSimulationModel.Type type) { final List<FactMapping> factMappings = abstractScesimModel.getScesimModelDescriptor().getUnmodifiableFactMappings(); boolean editableHeaders = !(ScenarioSimulationModel.Type.DMN.equals(type) || (abstractScesimModel instanceof Background)); IntStream.range(0, factMappings.size()) .forEach(columnIndex -> setHeaderColumn(columnIndex, factMappings.get(columnIndex), editableHeaders)); } ScenarioGrid(AbstractScesimGridModel model,
                        ScenarioGridLayer scenarioGridLayer,
                        ScenarioGridRenderer renderer,
                        ScenarioContextMenuRegistry scenarioContextMenuRegistry); void setContent(AbstractScesimModel abstractScesimModel, ScenarioSimulationModel.Type type); GridWidget getGridWidget(); EventBus getEventBus(); void setEventBus(EventBus eventBus); void setDefaultSelectedDataCell(int cellX, int cellY); ScenarioSimulationContext getScenarioSimulationContext(); void setScenarioSimulationContext(ScenarioSimulationContext scenarioSimulationContext); @Override AbstractScesimGridModel getModel(); ScenarioSimulationModel.Type getType(); void clearSelections(); void setSelectedColumn(int columnIndex); void setSelectedColumnAndHeader(int headerRowIndex, int columnIndex); void ensureCellIsSelected(); void setSelectedCell(int rowIndex, int columnIndex); @Override boolean adjustSelection(final SelectionExtension direction, final boolean isShiftKeyDown);  }
@Test public void setHeaderColumns() { scenarioGridSpy.setHeaderColumns(simulation, ScenarioSimulationModel.Type.RULE); verify(scenarioGridSpy, times(COLUMNS)).setHeaderColumn(anyInt(), isA(FactMapping.class), eq(true)); scenarioGridSpy.setHeaderColumns(simulation, ScenarioSimulationModel.Type.DMN); verify(scenarioGridSpy, times(COLUMNS)).setHeaderColumn(anyInt(), isA(FactMapping.class), eq(false)); Background background = new Background(); scenarioGridSpy.setHeaderColumns(background, ScenarioSimulationModel.Type.RULE); verify(scenarioGridSpy, times(COLUMNS)).setHeaderColumn(anyInt(), isA(FactMapping.class), eq(false)); scenarioGridSpy.setHeaderColumns(background, ScenarioSimulationModel.Type.DMN); verify(scenarioGridSpy, times(COLUMNS)).setHeaderColumn(anyInt(), isA(FactMapping.class), eq(false)); }