Search in sources :

Example 6 with GuidedDecisionTableUiModel

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);
}
Also used : MenuItemWithIconView(org.uberfire.ext.widgets.common.client.menu.MenuItemWithIconView) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) BaseGridRow(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow) MenuItemFactory(org.uberfire.ext.widgets.common.client.menu.MenuItemFactory) GuidedDecisionTableUiModel(org.drools.workbench.screens.guided.dtable.client.widget.table.model.GuidedDecisionTableUiModel) Annotation(java.lang.annotation.Annotation) Before(org.junit.Before)

Example 7 with GuidedDecisionTableUiModel

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();
}
Also used : DefaultClipboard(org.drools.workbench.screens.guided.dtable.client.editor.clipboard.impl.DefaultClipboard) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) BaseGridRow(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow) MenuItemFactory(org.uberfire.ext.widgets.common.client.menu.MenuItemFactory) GuidedDecisionTableUiModel(org.drools.workbench.screens.guided.dtable.client.widget.table.model.GuidedDecisionTableUiModel) Matchers.anyString(org.mockito.Matchers.anyString) Annotation(java.lang.annotation.Annotation) Before(org.junit.Before)

Example 8 with GuidedDecisionTableUiModel

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();
}
Also used : DefaultClipboard(org.drools.workbench.screens.guided.dtable.client.editor.clipboard.impl.DefaultClipboard) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) BaseGridRow(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow) GuidedDecisionTableUiModel(org.drools.workbench.screens.guided.dtable.client.widget.table.model.GuidedDecisionTableUiModel) BaseGridColumn(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridColumn) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) Before(org.junit.Before)

Aggregations

GuidedDecisionTableUiModel (org.drools.workbench.screens.guided.dtable.client.widget.table.model.GuidedDecisionTableUiModel)8 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)7 Before (org.junit.Before)7 BaseGridRow (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow)5 DefaultClipboard (org.drools.workbench.screens.guided.dtable.client.editor.clipboard.impl.DefaultClipboard)3 GridColumn (org.uberfire.ext.wires.core.grids.client.model.GridColumn)3 Annotation (java.lang.annotation.Annotation)2 MenuItemFactory (org.uberfire.ext.widgets.common.client.menu.MenuItemFactory)2 BaseGridColumn (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridColumn)2 EventBus (com.google.gwt.event.shared.EventBus)1 AbsolutePanel (com.google.gwt.user.client.ui.AbsolutePanel)1 Iterator (java.util.Iterator)1 BRLRuleModel (org.drools.workbench.models.guided.dtable.shared.model.BRLRuleModel)1 DescriptionCol52 (org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52)1 RowNumberCol52 (org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52)1 RuleNameColumn (org.drools.workbench.models.guided.dtable.shared.model.RuleNameColumn)1 GuidedDecisionTableModellerView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableModellerView)1 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)1 DecisionTableSelectionsChangedEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectionsChangedEvent)1 GridWidgetCellFactory (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.cell.GridWidgetCellFactory)1