Search in sources :

Example 1 with GridCell

use of org.uberfire.ext.wires.core.grids.client.model.GridCell in project drools-wb by kiegroup.

the class GuidedDecisionTableModellerContextMenuSupportTest method onContextMenuWithoutCellSelectionManager.

@Test
@SuppressWarnings("unchecked")
public void onContextMenuWithoutCellSelectionManager() {
    final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable();
    final GridData uiModel = dtPresenter.getView().getModel();
    final GridColumn uiColumn = new RowNumberColumn();
    uiModel.appendColumn(uiColumn);
    when(columnInformation.getColumn()).thenReturn(uiColumn);
    when(modellerPresenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {

        {
            add(dtPresenter);
        }
    });
    final GridCell uiCell = mock(GridCell.class);
    when(uiModel.getCell(any(Integer.class), any(Integer.class))).thenReturn(uiCell);
    when(uiCell.getSelectionStrategy()).thenReturn(null);
    final ContextMenuHandler handler = contextMenuSupport.getContextMenuHandler(modellerPresenter);
    handler.onContextMenu(event);
    verify(layer, never()).batch();
}
Also used : RowNumberColumn(org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn) GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) BaseGridColumn(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridColumn) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) ContextMenuHandler(com.google.gwt.event.dom.client.ContextMenuHandler) GridCell(org.uberfire.ext.wires.core.grids.client.model.GridCell) Test(org.junit.Test)

Aggregations

ContextMenuHandler (com.google.gwt.event.dom.client.ContextMenuHandler)1 Test (org.junit.Test)1 GridCell (org.uberfire.ext.wires.core.grids.client.model.GridCell)1 GridColumn (org.uberfire.ext.wires.core.grids.client.model.GridColumn)1 GridData (org.uberfire.ext.wires.core.grids.client.model.GridData)1 BaseGridColumn (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridColumn)1 BaseGridData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData)1 RowNumberColumn (org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn)1