use of org.drools.workbench.screens.scenariosimulation.client.events.DisableTestToolsEvent in project drools-wb by kiegroup.
the class ScenarioSimulationEventHandlerTest method onDisableTestToolsEvent.
@Test
public void onDisableTestToolsEvent() {
DisableTestToolsEvent event = new DisableTestToolsEvent();
scenarioSimulationEventHandler.onEvent(event);
verify(scenarioSimulationEventHandler).commonExecution(isA(DisableTestToolsCommand.class), eq(false));
}
use of org.drools.workbench.screens.scenariosimulation.client.events.DisableTestToolsEvent in project drools-wb by kiegroup.
the class ScenarioSimulationMainGridPanelClickHandler method manageBodyCoordinates.
/**
* This method check if the click happened on an column of a <b>grid row</b>. If it is so, select the cell,
* otherwise returns <code>false</code>
* @param uiRowIndex
* @param uiColumnIndex
* @return
*/
@Override
protected boolean manageBodyCoordinates(Integer uiRowIndex, Integer uiColumnIndex) {
final GridCell<?> cell = scenarioGrid.getModel().getCell(uiRowIndex, uiColumnIndex);
if (cell == null) {
return false;
} else {
scenarioGrid.getModel().selectCell(uiRowIndex, uiColumnIndex);
eventBus.fireEvent(new DisableTestToolsEvent());
return true;
}
}
use of org.drools.workbench.screens.scenariosimulation.client.events.DisableTestToolsEvent in project drools-wb by kiegroup.
the class ScenarioSimulationMainGridPanelClickHandler method onClick.
@Override
public void onClick(ClickEvent event) {
clickReceived.getAndIncrement();
final int canvasX = getRelativeXOfEvent(event);
final int canvasY = getRelativeYOfEvent(event);
scenarioContextMenuRegistry.hideMenus();
scenarioContextMenuRegistry.hideErrorReportPopover();
if (!manageCoordinates(canvasX, canvasY)) {
// It was not a grid click
eventBus.fireEvent(new DisableTestToolsEvent());
}
}
use of org.drools.workbench.screens.scenariosimulation.client.events.DisableTestToolsEvent in project drools-wb by kiegroup.
the class ScenarioGrid method signalTestTools.
protected void signalTestTools() {
eventBus.fireEvent(new DisableTestToolsEvent());
if (!model.getSelectedHeaderCells().isEmpty()) {
final GridData.SelectedCell cell = model.getSelectedHeaderCells().get(0);
final int uiColumnIndex = ColumnIndexUtilities.findUiColumnIndex(model.getColumns(), cell.getColumnIndex());
final int uiRowIndex = cell.getRowIndex();
setSelectedColumn(uiColumnIndex);
final GridColumn column = model.getColumns().get(uiColumnIndex);
if (uiRowIndex > 0 && column instanceof ScenarioGridColumn) {
signalTestToolsHeaderCellSelected((ScenarioGridColumn) column, cell, uiColumnIndex);
}
}
}
Aggregations