use of org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow in project kie-wb-common by kiegroup.
the class BaseExpressionGridGeneralTest method testDeselect.
@Test
public void testDeselect() {
grid.getModel().appendRow(new DMNGridRow());
appendColumns(GridColumn.class);
// Select a cell so we can check deselection clears selections
grid.getModel().selectCell(0, 0);
assertFalse(grid.getModel().getSelectedCells().isEmpty());
grid.deselect();
assertTrue(grid.getModel().getSelectedCells().isEmpty());
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow in project kie-wb-common by kiegroup.
the class BaseExpressionGridGeneralTest method testSelectFirstCellWithRowAndNonRowNumberColumn.
@Test
public void testSelectFirstCellWithRowAndNonRowNumberColumn() {
grid.getModel().appendRow(new DMNGridRow());
appendColumns(GridColumn.class);
grid.selectFirstCell();
assertThat(grid.getModel().getSelectedCells()).isNotEmpty();
assertThat(grid.getModel().getSelectedCells()).contains(new GridData.SelectedCell(0, 0));
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow in project kie-wb-common by kiegroup.
the class ExpressionEditorColumnTest method testMinimalWidthDefaultWidthWithPadding.
/**
* (10)[99](10)
* (10)[30][30][30](10)
* (10)[49][50](10)
*/
@Test
public void testMinimalWidthDefaultWidthWithPadding() throws Exception {
gridData.appendColumn(column);
gridData.appendRow(new DMNGridRow());
gridData.appendRow(new DMNGridRow());
gridData.appendRow(new DMNGridRow());
mockCellsWithPadding(0, 0, PADDING, 99);
mockCellsWithPadding(1, 0, PADDING, 30, 30, 30);
mockCellsWithPadding(2, 0, PADDING, 49, 50);
Assertions.assertThat(column.getMinimumWidth()).isEqualTo(119);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow in project kie-wb-common by kiegroup.
the class ExpressionEditorColumnTest method testUpdateInternalWidth.
@Test
public void testUpdateInternalWidth() throws Exception {
gridData.appendColumn(column);
gridData.appendRow(new DMNGridRow());
gridData.appendRow(new DMNGridRow());
gridData.appendRow(new DMNGridRow());
mockCells(0, 0, 100);
mockCells(1, 0, 110);
mockCells(2, 0, 50, 60);
column.setWidthInternal(200D);
Assertions.assertThat(getColumnWidth(0, 0, 0)).isEqualTo(200D);
Assertions.assertThat(getColumnWidth(1, 0, 0)).isEqualTo(200D);
Assertions.assertThat(getColumnWidth(2, 0, 0)).isEqualTo(50D);
Assertions.assertThat(getColumnWidth(2, 0, 1)).isEqualTo(150D);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow in project kie-wb-common by kiegroup.
the class ExpressionEditorColumnTest method testUpdateInternalWidthResizedToSmaller.
@Test
public void testUpdateInternalWidthResizedToSmaller() throws Exception {
gridData.appendColumn(column);
gridData.appendRow(new DMNGridRow());
gridData.appendRow(new DMNGridRow());
gridData.appendRow(new DMNGridRow());
mockCells(0, 0, 100);
mockCells(1, 0, 30, 30, 30);
mockCells(2, 0, 50, 60);
column.setWidthInternal(80D);
Assertions.assertThat(getColumnWidth(0, 0, 0)).isEqualTo(80D);
Assertions.assertThat(getColumnWidth(1, 0, 0)).isEqualTo(30D);
Assertions.assertThat(getColumnWidth(1, 0, 1)).isEqualTo(30D);
Assertions.assertThat(getColumnWidth(1, 0, 2)).isEqualTo(20D);
Assertions.assertThat(getColumnWidth(2, 0, 0)).isEqualTo(50D);
Assertions.assertThat(getColumnWidth(2, 0, 1)).isEqualTo(30D);
}
Aggregations