use of org.uberfire.ext.wires.core.grids.client.model.GridRow in project kie-wb-common by kiegroup.
the class LiteralExpressionGridRowTest method testEmptyRow.
@Test
public void testEmptyRow() {
final GridRow row = new LiteralExpressionGridRow();
assertThat(row.getHeight()).isEqualTo(DEFAULT_HEIGHT);
}
use of org.uberfire.ext.wires.core.grids.client.model.GridRow in project kie-wb-common by kiegroup.
the class LiteralExpressionGridRowTest method testGetHeightWithHasDynamicHeightCell.
@Test
public void testGetHeightWithHasDynamicHeightCell() {
final GridRow row = spy(new LiteralExpressionGridRow());
final Map<Integer, GridCell> cells = new HashMap<Integer, GridCell>() {
{
put(0, new MockHasDynamicHeightCell<>(new BaseGridCellValue<>("cheese")));
put(1, new BaseGridCell<>(new BaseGridCellValue<>("cheese")));
}
};
doReturn(cells).when(row).getCells();
assertThat(row.getHeight()).isEqualTo(CELL_HEIGHT);
}
use of org.uberfire.ext.wires.core.grids.client.model.GridRow in project kie-wb-common by kiegroup.
the class LiteralExpressionGridRowTest method testGetHeightWithoutHasDynamicHeightCell.
@Test
public void testGetHeightWithoutHasDynamicHeightCell() {
final GridRow row = spy(new LiteralExpressionGridRow());
final Map<Integer, GridCell> cells = new HashMap<Integer, GridCell>() {
{
put(0, new BaseGridCell<>(new BaseGridCellValue<>("cheese")));
}
};
doReturn(cells).when(row).getCells();
assertThat(row.getHeight()).isEqualTo(DEFAULT_HEIGHT);
}
use of org.uberfire.ext.wires.core.grids.client.model.GridRow in project drools-wb by kiegroup.
the class RowSynchronizer method insert.
@Override
public void insert(final RowMetaData metaData) throws VetoException {
if (!handlesAppend(metaData)) {
return;
}
final int rowIndex = metaData.getRowIndex();
final List<DTCellValue52> modelRow = new ArrayList<DTCellValue52>();
model.getData().add(rowIndex, modelRow);
final GridRow uiModelRow = new BaseGridRow(GuidedDecisionTableView.ROW_HEIGHT);
uiModel.insertRow(rowIndex, uiModelRow);
initialiseRowData(rowIndex);
}
use of org.uberfire.ext.wires.core.grids.client.model.GridRow in project drools-wb by kiegroup.
the class ScenarioContextMenuRegistryTest method testManageBodyRightClick.
@Test
public void testManageBodyRightClick() {
final int clickPointX = 5;
final int clickPointY = 11;
final double widgetHeight = 50.0;
final double rowHeight = widgetHeight - HEADER_HEIGHT;
doReturn(clickPointX).when(contextNativeEventMock).getClientX();
doReturn(clickPointY).when(contextNativeEventMock).getClientY();
doReturn(widgetHeight).when(scenarioGridMock).getHeight();
doReturn(1).when(scenarioGridModelMock).getRowCount();
final GridRow gridRowMock = mock(GridRow.class);
doReturn(gridRowMock).when(scenarioGridModelMock).getRow(0);
doReturn(rowHeight).when(gridRowMock).getHeight();
assertThat(scenarioContextMenuRegistry.manageRightClick(scenarioGridMock, contextMenuEventMock)).as("Click to expect/given body cell").isTrue();
verify(scenarioGridMock, times(1)).clearSelections();
verify(gridContextMenuMock).show(GridWidget.SIMULATION, clickPointX, clickPointY, 0);
verify(scenarioGridMock, times(1)).setSelectedCell(eq(0), eq(0));
}
Aggregations