use of org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyCellEditContext in project kie-wb-common by kiegroup.
the class EditablePopupHeaderMetaDataTest method testEditWithNoRelationLocation.
@Test
public void testEditWithNoRelationLocation() {
final GridBodyCellEditContext context = new GridBodyCellEditContext(ABSOLUTE_CELL_X, ABSOLUTE_CELL_Y, CELL_WIDTH, CELL_HEIGHT, CLIP_MIN_Y, CLIP_MIN_X, ROW_INDEX, COLUMN_INDEX, IS_FLOATING, transform, renderer, Optional.empty());
header.edit(context);
verify(editor).bind(eq(gridWidget), eq(ROW_INDEX), eq(COLUMN_INDEX));
verify(cellEditorControls).show(eq(editor), eq((int) (ABSOLUTE_CELL_X + CELL_WIDTH / 2)), eq((int) (ABSOLUTE_CELL_Y + CELL_HEIGHT / 2)));
}
use of org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyCellEditContext in project drools-wb by kiegroup.
the class ScenarioSimulationUtils method getMiddleXYCell.
/**
* Returns an array where the 0-element is middle x of given cell and 1-element is middle y
* @param gridWidget
* @param column
* @param isHeader
* @param uiRowIndex
* @param gridLayer
* @return
*/
public static Point2D getMiddleXYCell(final GridWidget gridWidget, final GridColumn<?> column, boolean isHeader, final int uiRowIndex, final GridLayer gridLayer) {
final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation();
final double columnXCoordinate = rendererHelper.getColumnOffset(column) + column.getWidth() / 2;
final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(columnXCoordinate);
final GridBodyCellEditContext context = isHeader ? CellContextUtilities.makeHeaderCellRenderContext(gridWidget, ri, ci, uiRowIndex) : CellContextUtilities.makeCellRenderContext(gridWidget, ri, ci, uiRowIndex);
final int cellXMiddle = (int) (context.getAbsoluteCellX() + context.getCellWidth() / 2 + gridLayer.getDomElementContainer().getAbsoluteLeft());
final int cellYMiddle = (int) (context.getAbsoluteCellY() + context.getCellHeight() / 2 + gridLayer.getDomElementContainer().getAbsoluteTop());
return new Point2D(cellXMiddle, cellYMiddle);
}
Aggregations