use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow 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() {
gridData.appendColumn(column);
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
mockCellsWithPadding(0, 0, PADDING, 99);
mockCellsWithPadding(1, 0, PADDING, 30, 30, 30);
mockCellsWithPadding(2, 0, PADDING, 49, 50);
assertThat(column.getMinimumWidth()).isEqualTo(119);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class ExpressionEditorColumnTest method testMinimalWidthThreeCellsSum.
/**
* [100]
* [50][60]
* [50][60][10]
*/
@Test
public void testMinimalWidthThreeCellsSum() {
gridData.appendColumn(column);
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
mockCells(0, 0, 100);
mockCells(1, 0, 50, 60);
mockCells(2, 0, 50, 60, 10);
assertThat(column.getMinimumWidth()).isEqualTo(120);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class ExpressionEditorColumnTest method testUpdateInternalWidth.
@Test
public void testUpdateInternalWidth() {
gridData.appendColumn(column);
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
mockCells(0, 0, 100);
mockCells(1, 0, 110);
mockCells(2, 0, 50, 60);
column.setWidthInternal(200D);
assertThat(getColumnWidth(0, 0, 0)).isEqualTo(200D);
assertThat(getColumnWidth(1, 0, 0)).isEqualTo(200D);
assertThat(getColumnWidth(2, 0, 0)).isEqualTo(50D);
assertThat(getColumnWidth(2, 0, 1)).isEqualTo(150D);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class RelationColumnTest method setUp.
@Before
public void setUp() throws Exception {
parentUiModel = new BaseGridData();
parentUiModel.appendRow(new BaseGridRow());
parentUiModel.appendRow(new BaseGridRow());
parentUiModel.appendRow(new BaseGridRow());
parentUiModel.appendColumn(mock(ExpressionEditorColumn.class));
final GridCellTuple parent = new GridCellTuple(0, 0, parentGridWidget);
doReturn(parentUiModel).when(parentGridWidget).getModel();
doReturn(widget).when(domElement).getWidget();
doReturn(parent).when(gridWidget).getParentInformation();
doReturn(100.0).when(gridWidget).getWidth();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project kie-wb-common by kiegroup.
the class RelationUIModelMapperTest method setup.
@Before
public void setup() {
this.uiModel = new BaseGridData();
this.uiModel.appendRow(new BaseGridRow());
this.uiModel.appendRow(new BaseGridRow());
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModel.appendColumn(uiRelationColumn1);
this.uiModel.appendColumn(uiRelationColumn2);
when(uiRowNumberColumn.getIndex()).thenReturn(0);
when(uiRelationColumn1.getIndex()).thenReturn(1);
when(uiRelationColumn2.getIndex()).thenReturn(2);
this.relation = new Relation();
this.relation.getColumn().add(new InformationItem());
this.relation.getColumn().add(new InformationItem());
final List rowList1 = new List();
rowList1.getExpression().add(HasExpression.wrap(rowList1, new LiteralExpression() {
{
getText().setValue("le(1,0)");
}
}));
rowList1.getExpression().add(HasExpression.wrap(rowList1, new LiteralExpression() {
{
getText().setValue("le(2,0)");
}
}));
final List rowList2 = new List();
rowList2.getExpression().add(HasExpression.wrap(rowList2, new LiteralExpression() {
{
getText().setValue("le(1,1)");
}
}));
rowList2.getExpression().add(HasExpression.wrap(rowList2, new LiteralExpression() {
{
getText().setValue("le(2,1)");
}
}));
this.relation.getRow().add(rowList1);
this.relation.getRow().add(rowList2);
this.mapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector, DEFAULT_HEIGHT);
this.cellValueSupplier = Optional::empty;
}
Aggregations