use of org.uberfire.ext.wires.core.grids.client.model.GridData in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method onInsertRowBelowSingleRowSelected.
@Test
public void onInsertRowBelowSingleRowSelected() throws VetoException {
final GridData uiModel = dtPresenter.getUiModel();
uiModel.selectCell(0, 0);
dtPresenter.onInsertRowBelow();
verify(synchronizer, times(1)).insertRow(eq(1));
}
use of org.uberfire.ext.wires.core.grids.client.model.GridData in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method onInsertRowAboveSingleRowSelected.
@Test
public void onInsertRowAboveSingleRowSelected() throws VetoException {
final GridData uiModel = dtPresenter.getUiModel();
uiModel.selectCell(0, 0);
dtPresenter.onInsertRowAbove();
verify(synchronizer, times(1)).insertRow(eq(0));
}
use of org.uberfire.ext.wires.core.grids.client.model.GridData in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method onInsertRowAboveMultipleRowsSelected.
@Test
public void onInsertRowAboveMultipleRowsSelected() throws VetoException {
final GridData uiModel = dtPresenter.getUiModel();
uiModel.selectCell(0, 0);
uiModel.selectCell(1, 0);
dtPresenter.onInsertRowAbove();
verify(synchronizer, never()).insertRow(any(Integer.class));
}
use of org.uberfire.ext.wires.core.grids.client.model.GridData in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method onDeleteSelectedCellsWithSelectionWithBooleanColumn.
@Test
public void onDeleteSelectedCellsWithSelectionWithBooleanColumn() {
final AttributeCol52 column = new AttributeCol52() {
{
setAttribute(RuleAttributeWidget.ENABLED_ATTR);
}
};
dtPresenter.appendColumn(column);
final GridData uiModel = dtPresenter.getUiModel();
uiModel.selectCell(0, 2);
dtPresenter.onDeleteSelectedCells();
verify(synchronizer, never()).deleteCell(any(GridData.Range.class), any(Integer.class));
checkDTSelectionsChangedEventFired(1);
}
use of org.uberfire.ext.wires.core.grids.client.model.GridData in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method onDeleteSelectedCellsWithSelection.
@Test
public void onDeleteSelectedCellsWithSelection() {
final GridData uiModel = dtPresenter.getUiModel();
uiModel.selectCell(0, 1);
final ArgumentCaptor<Integer> columnIndexCaptor = ArgumentCaptor.forClass(Integer.class);
final ArgumentCaptor<GridData.Range> rowRangeCaptor = ArgumentCaptor.forClass(GridData.Range.class);
dtPresenter.onDeleteSelectedCells();
verify(synchronizer, times(1)).deleteCell(rowRangeCaptor.capture(), columnIndexCaptor.capture());
checkDTSelectionsChangedEventFired(2);
final Integer columnIndex = columnIndexCaptor.getValue();
final GridData.Range rowRange = rowRangeCaptor.getValue();
assertEquals(0, rowRange.getMinRowIndex());
assertEquals(0, rowRange.getMaxRowIndex());
assertEquals(1, columnIndex.intValue());
}
Aggregations