use of org.drools.workbench.screens.scenariosimulation.client.events.SetHeaderCellValueEvent in project drools-wb by kiegroup.
the class ScenarioHeaderTextAreaDOMElement method internalFlush.
@Override
protected void internalFlush(final String value) {
final int rowIndex = context.getRowIndex();
final int columnIndex = context.getColumnIndex();
try {
boolean isInstanceHeader = scenarioHeaderMetaData != null && Objects.equals(scenarioHeaderMetaData.getMetadataType(), ScenarioHeaderMetaData.MetadataType.INSTANCE);
boolean isPropertyHeader = scenarioHeaderMetaData != null && Objects.equals(scenarioHeaderMetaData.getMetadataType(), ScenarioHeaderMetaData.MetadataType.PROPERTY);
((ScenarioGrid) gridWidget).getEventBus().fireEvent(new SetHeaderCellValueEvent(((ScenarioGrid) gridWidget).getGridWidget(), rowIndex, columnIndex, value, isInstanceHeader, isPropertyHeader));
((ScenarioGrid) gridWidget).getEventBus().fireEvent(new ReloadTestToolsEvent(true));
} catch (Exception e) {
throw new IllegalArgumentException(new StringBuilder().append("Impossible to update header (").append(rowIndex).append(") of column ").append(columnIndex).toString(), e);
}
}
use of org.drools.workbench.screens.scenariosimulation.client.events.SetHeaderCellValueEvent in project drools-wb by kiegroup.
the class ScenarioSimulationEventHandlerTest method onSetHeaderCellValueEventInstanceHeader.
@Test
public void onSetHeaderCellValueEventInstanceHeader() {
SetHeaderCellValueEvent event = new SetHeaderCellValueEvent(GridWidget.SIMULATION, ROW_INDEX, COLUMN_INDEX, MULTIPART_VALUE, true, false);
scenarioSimulationEventHandler.onEvent(event);
verify(scenarioSimulationEventHandler).commonExecution(isA(SetHeaderCellValueCommand.class), eq(false));
}
use of org.drools.workbench.screens.scenariosimulation.client.events.SetHeaderCellValueEvent in project drools-wb by kiegroup.
the class ScenarioSimulationEventHandlerTest method onSetHeaderCellValueEventPropertyHeader.
@Test
public void onSetHeaderCellValueEventPropertyHeader() {
SetHeaderCellValueEvent event = new SetHeaderCellValueEvent(GridWidget.SIMULATION, ROW_INDEX, COLUMN_INDEX, MULTIPART_VALUE, false, true);
scenarioSimulationEventHandler.onEvent(event);
verify(scenarioSimulationEventHandler).commonExecution(isA(SetHeaderCellValueCommand.class), eq(false));
}
Aggregations