use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project drools-wb by kiegroup.
the class GuidedDecisionTableRendererTest method setup.
@Before
public void setup() {
this.uiModel = new GuidedDecisionTableUiModel(synchronizer);
this.uiColumn = new RowNumberColumn();
this.uiModel.appendColumn(uiColumn);
this.uiModel.appendRow(new BaseGridRow());
this.renderer = new GuidedDecisionTableRenderer(uiModel, new GuidedDecisionTable52());
doReturn(new ArrayList<Double>() {
{
add(20.0);
}
}).when(renderingInformation).getVisibleRowOffsets();
doReturn(new ArrayList<GridColumn<?>>() {
{
add(uiColumn);
}
}).when(context).getBlockColumns();
doReturn(bodyBlockInformation).when(renderingInformation).getBodyBlockInformation();
doReturn(new ArrayList<GridColumn<?>>() {
{
add(uiColumn);
}
}).when(bodyBlockInformation).getColumns();
doReturn(floatingBlockInformation).when(renderingInformation).getFloatingBlockInformation();
doReturn(Collections.emptyList()).when(floatingBlockInformation).getColumns();
doReturn(renderer).when(context).getRenderer();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project drools-wb by kiegroup.
the class InsertMenuBuilderTest method setup.
@Before
public void setup() {
model = new GuidedDecisionTable52();
uiModel = new GuidedDecisionTableUiModel(mock(ModelSynchronizer.class));
final MenuItemFactory menuItemFactory = new MenuItemFactory(menuItemViewProducer);
when(dtPresenter.hasEditableColumns()).thenReturn(true);
when(dtPresenter.getView()).thenReturn(dtPresenterView);
when(dtPresenter.getModel()).thenReturn(model);
when(dtPresenter.getAccess()).thenReturn(access);
when(dtPresenterView.getModel()).thenReturn(uiModel);
when(translationService.getTranslation(any(String.class))).thenReturn("i18n");
when(menuItemViewProducer.select(any(Annotation.class))).thenReturn(menuItemViewProducer);
when(menuItemViewProducer.get()).thenReturn(mock(MenuItemWithIconView.class));
uiModel.appendColumn(new BaseGridColumn<>(headerMetaData, gridColumnRenderer, 100));
uiModel.appendColumn(new BaseGridColumn<>(headerMetaData, gridColumnRenderer, 100));
uiModel.appendColumn(new BaseGridColumn<>(headerMetaData, gridColumnRenderer, 100));
uiModel.appendRow(new BaseGridRow());
uiModel.appendRow(new BaseGridRow());
builder = spy(new InsertMenuBuilder(translationService, menuItemFactory, wizardManagedInstance));
builder.setup();
builder.setModeller(modeller);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project drools-wb by kiegroup.
the class EditMenuBuilderTest method setup.
@Before
public void setup() {
model = new GuidedDecisionTable52();
uiModel = new GuidedDecisionTableUiModel(mock(ModelSynchronizer.class));
clipboard = new DefaultClipboard();
final MenuItemFactory menuItemFactory = new MenuItemFactory(menuItemViewProducer);
when(dtPresenter.hasEditableColumns()).thenReturn(true);
when(dtPresenter.getView()).thenReturn(dtPresenterView);
when(dtPresenter.getModel()).thenReturn(model);
when(dtPresenter.getAccess()).thenReturn(access);
when(dtPresenterView.getModel()).thenReturn(uiModel);
when(ts.getTranslation(any(String.class))).thenReturn("i18n");
when(menuItemViewProducer.select(any(Annotation.class))).thenReturn(menuItemViewProducer);
when(menuItemViewProducer.get()).thenReturn(menuItemWithIconView);
when(menuItemWithIconView.getElement()).thenReturn(menuItemHTMLElement);
uiModel.appendColumn(new BaseGridColumn<>(headerMetaData, gridColumnRenderer, 100));
uiModel.appendColumn(new BaseGridColumn<>(headerMetaData, gridColumnRenderer, 100));
uiModel.appendColumn(new BaseGridColumn<>(headerMetaData, gridColumnRenderer, 100));
uiModel.appendRow(new BaseGridRow());
builder = spy(new EditMenuBuilder(clipboard, ts, menuItemFactory, popoverUtils));
builder.setup();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project drools-wb by kiegroup.
the class RowContextMenuTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() {
model = new GuidedDecisionTable52();
uiModel = new GuidedDecisionTableUiModel(mock(ModelSynchronizer.class));
clipboard = new DefaultClipboard();
when(dtPresenter.getView()).thenReturn(dtPresenterView);
when(dtPresenter.getModel()).thenReturn(model);
when(dtPresenter.getAccess()).thenReturn(access);
when(dtPresenterView.getModel()).thenReturn(uiModel);
uiModel.appendColumn(new BaseGridColumn<String>(mock(GridColumn.HeaderMetaData.class), mock(GridColumnRenderer.class), 100));
uiModel.appendColumn(new BaseGridColumn<String>(mock(GridColumn.HeaderMetaData.class), mock(GridColumnRenderer.class), 100));
uiModel.appendColumn(new BaseGridColumn<String>(mock(GridColumn.HeaderMetaData.class), mock(GridColumnRenderer.class), 100));
uiModel.appendRow(new BaseGridRow());
menu = spy(new RowContextMenu(view, clipboard));
menu.setup();
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow in project drools-wb by kiegroup.
the class RowSynchronizer method insert.
@Override
public void insert(final RowMetaData metaData) throws VetoException {
if (!handlesAppend(metaData)) {
return;
}
final int rowIndex = metaData.getRowIndex();
final List<DTCellValue52> modelRow = new ArrayList<DTCellValue52>();
model.getData().add(rowIndex, modelRow);
final GridRow uiModelRow = new BaseGridRow(GuidedDecisionTableView.ROW_HEIGHT);
uiModel.insertRow(rowIndex, uiModelRow);
initialiseRowData(rowIndex);
}
Aggregations