use of org.drools.workbench.screens.guided.dtable.client.widget.table.model.GuidedDecisionTableUiModel 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.drools.workbench.screens.guided.dtable.client.widget.table.model.GuidedDecisionTableUiModel 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.appendColumn(new BaseGridColumn<>(headerMetaData, gridColumnRenderer, 100));
uiModel.appendRow(new BaseGridRow());
builder = spy(new EditMenuBuilder(clipboard, ts, menuItemFactory, popoverUtils));
builder.setup();
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.model.GuidedDecisionTableUiModel 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.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();
}
Aggregations