use of org.uberfire.ext.wires.core.grids.client.model.GridRow in project drools-wb by kiegroup.
the class RowSynchronizerTest method testMoveRowsMoveDown.
@Test
public void testMoveRowsMoveDown() throws VetoException {
modelSynchronizer.appendRow();
modelSynchronizer.appendRow();
modelSynchronizer.appendRow();
final GridRow uiRow0 = uiModel.getRow(0);
final GridRow uiRow1 = uiModel.getRow(1);
final GridRow uiRow2 = uiModel.getRow(2);
final List<DTCellValue52> row0 = model.getData().get(0);
final List<DTCellValue52> row1 = model.getData().get(1);
final List<DTCellValue52> row2 = model.getData().get(2);
uiModel.moveRowsTo(2, new ArrayList<GridRow>() {
{
add(uiRow0);
add(uiRow1);
}
});
assertEquals(uiRow2, uiModel.getRow(0));
assertEquals(uiRow0, uiModel.getRow(1));
assertEquals(uiRow1, uiModel.getRow(2));
assertEquals(row2, model.getData().get(0));
assertEquals(row0, model.getData().get(1));
assertEquals(row1, model.getData().get(2));
}
use of org.uberfire.ext.wires.core.grids.client.model.GridRow in project drools-wb by kiegroup.
the class RowSynchronizerTest method testMoveRowMoveDownMidBlock.
@Test
public void testMoveRowMoveDownMidBlock() throws VetoException {
modelSynchronizer.appendRow();
modelSynchronizer.appendRow();
modelSynchronizer.appendRow();
final GridRow uiRow0 = uiModel.getRow(0);
final GridRow uiRow1 = uiModel.getRow(1);
final GridRow uiRow2 = uiModel.getRow(2);
final List<DTCellValue52> row0 = model.getData().get(0);
final List<DTCellValue52> row1 = model.getData().get(1);
final List<DTCellValue52> row2 = model.getData().get(2);
uiModel.moveRowsTo(1, new ArrayList<GridRow>() {
{
add(uiRow0);
}
});
assertEquals(uiRow1, uiModel.getRow(0));
assertEquals(uiRow0, uiModel.getRow(1));
assertEquals(uiRow2, uiModel.getRow(2));
assertEquals(row1, model.getData().get(0));
assertEquals(row0, model.getData().get(1));
assertEquals(row2, model.getData().get(2));
}
Aggregations