use of org.uberfire.ext.wires.core.grids.client.model.GridCellEditAction in project kie-wb-common by kiegroup.
the class DelegatingGridWidgetEditCellMouseEventHandler method delegatedHandleBodyCell.
private boolean delegatedHandleBodyCell(final GridWidget gridWidget, final Point2D relativeLocation, final int uiRowIndex, final int uiColumnIndex, final AbstractNodeMouseEvent event) {
final GridCellTuple parent = parentSupplier.get();
final GridWidget parentGridWidget = parent.getGridWidget();
final GridData parentGridData = parentGridWidget.getModel();
if (parentGridData.getSelectedCells().size() == 1) {
final GridData gridData = gridWidget.getModel();
final GridCell<?> cell = gridData.getCell(uiRowIndex, uiColumnIndex);
final GridCellEditAction cellEditAction = cell == null ? GridCell.DEFAULT_EDIT_ACTION : cell.getSupportedEditAction();
if (isEventHandled(cellEditAction, event)) {
return gridWidget.startEditingCell(relativeLocation);
}
}
return false;
}
use of org.uberfire.ext.wires.core.grids.client.model.GridCellEditAction in project drools-wb by kiegroup.
the class ScenarioSimulationGridWidgetMouseEventHandler method handleBodyCell.
/**
* Checks if a {@link AbstractNodeMouseEvent} happened within a {@link GridCell}. If the
* {@link AbstractNodeMouseEvent} is found to have happened within a cell, the {@link GridCell#getSupportedEditAction()}
* is checked to {@link Object#equals(Object)} that for the {@link AbstractNodeMouseEvent}. If they equal then the
* {@link GridCell} is put into "edit" mode via {@link GridWidget#startEditingCell(Point2D)}.
*/
@Override
public boolean handleBodyCell(final GridWidget gridWidget, final Point2D relativeLocation, final int uiRowIndex, final int uiColumnIndex, final AbstractNodeMouseEvent event) {
final GridData gridData = gridWidget.getModel();
if (gridData.getSelectedCells().size() == 1) {
final GridCell<?> cell = gridData.getCell(uiRowIndex, uiColumnIndex);
final GridCellEditAction cellEditAction = cell == null ? GridCell.DEFAULT_EDIT_ACTION : cell.getSupportedEditAction();
if (editSupportedLocal(cellEditAction, event)) {
ScenarioGridColumn scenarioGridColumn = (ScenarioGridColumn) gridWidget.getModel().getColumns().get(uiColumnIndex);
return startEditLocal((ScenarioGrid) gridWidget, uiColumnIndex, scenarioGridColumn, uiRowIndex, false);
}
}
return false;
}
Aggregations