Search in sources :

Example 11 with GridData

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));
}
Also used : GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Test(org.junit.Test)

Example 12 with GridData

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));
}
Also used : GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Test(org.junit.Test)

Example 13 with GridData

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));
}
Also used : GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Test(org.junit.Test)

Example 14 with GridData

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);
}
Also used : AttributeCol52(org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52) GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Test(org.junit.Test)

Example 15 with GridData

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());
}
Also used : GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Test(org.junit.Test)

Aggregations

GridData (org.uberfire.ext.wires.core.grids.client.model.GridData)30 BaseGridData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData)22 Test (org.junit.Test)19 ContextMenuHandler (com.google.gwt.event.dom.client.ContextMenuHandler)8 GridColumn (org.uberfire.ext.wires.core.grids.client.model.GridColumn)8 BaseGridColumn (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridColumn)8 RowNumberColumn (org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn)6 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)5 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)3 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)2 BaseGridRow (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow)2 GridColumnRenderer (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.columns.GridColumnRenderer)2 GridRenderer (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)2 Point2D (com.ait.lienzo.client.core.types.Point2D)1 HashSet (java.util.HashSet)1 GridCell (org.uberfire.ext.wires.core.grids.client.model.GridCell)1 BaseGridRendererHelper (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper)1