use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class DMNGridLayerTest method testRemove.
@Test
@SuppressWarnings("unchecked")
public void testRemove() {
final GridWidget gridWidget = mock(GridWidget.class);
when(gridWidget.getModel()).thenReturn(new BaseGridData(false));
when(expressionGrid.getModel()).thenReturn(new BaseGridData(false));
when(gridWidget.asNode()).thenReturn(mock(Node.class));
when(expressionGrid.asNode()).thenReturn(mock(Node.class));
gridLayer.add(gridWidget);
gridLayer.add(expressionGrid);
gridLayer.select(expressionGrid);
gridLayer.remove(gridWidget);
assertThat(gridLayer.getSelectedGridWidget().isPresent()).isTrue();
assertThat(gridLayer.getSelectedGridWidget().get()).isEqualTo(expressionGrid);
gridLayer.remove(expressionGrid);
assertThat(gridLayer.getSelectedGridWidget().isPresent()).isFalse();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class DMNGridLayerTest method testRemoveAll.
@Test
@SuppressWarnings("unchecked")
public void testRemoveAll() {
final GridWidget gridWidget = mock(GridWidget.class);
when(gridWidget.getModel()).thenReturn(new BaseGridData(false));
when(expressionGrid.getModel()).thenReturn(new BaseGridData(false));
when(gridWidget.asNode()).thenReturn(mock(Node.class));
when(expressionGrid.asNode()).thenReturn(mock(Node.class));
gridLayer.add(gridWidget);
gridLayer.add(expressionGrid);
gridLayer.select(expressionGrid);
gridLayer.removeAll();
assertThat(gridLayer.getSelectedGridWidget().isPresent()).isFalse();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class GridCellTupleTest method setup.
@Before
public void setup() {
tuple = new GridCellTuple(0, 0, gridWidget);
gridData = new BaseGridData(false);
gridData.appendColumn(gridColumn);
gridData.appendRow(new BaseGridRow());
when(gridWidget.getModel()).thenReturn(gridData);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class BaseDOMElementTest method setup.
@Before
public void setup() {
widget = getWidget();
when(widget.getElement()).thenReturn(widgetElement);
when(widgetElement.getStyle()).thenReturn(widgetElementStyle);
when(sessionManager.getCurrentSession()).thenReturn(session);
when(session.getCanvasHandler()).thenReturn(canvasHandler);
when(context.getRowIndex()).thenReturn(0);
when(context.getColumnIndex()).thenReturn(1);
when(gridWidget.getModel()).thenReturn(new BaseGridData());
domElement = getDomElement();
domElement.setContext(context);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData in project kie-wb-common by kiegroup.
the class BaseSingletonDOMElementFactoryTest method setup.
@Before
public void setup() {
when(context.getTransform()).thenReturn(new Transform());
when(gridLayer.getDomElementContainer()).thenReturn(new AbsolutePanel());
when(sessionManager.getCurrentSession()).thenReturn(session);
when(session.getCanvasHandler()).thenReturn(canvasHandler);
when(gridWidget.getModel()).thenReturn(new BaseGridData());
}
Aggregations