Search in sources :

Example 1 with RefreshConditionsPanelEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenter method refreshColumnsPage.

void refreshColumnsPage() {
    refreshAttributesPanelEvent.fire(new RefreshAttributesPanelEvent(this, model.getAttributeCols()));
    refreshMetaDataPanelEvent.fire(new RefreshMetaDataPanelEvent(this, model.getMetadataCols()));
    refreshConditionsPanelEvent.fire(new RefreshConditionsPanelEvent(this, model.getConditions()));
    refreshActionsPanelEvent.fire(new RefreshActionsPanelEvent(this, model.getActionCols()));
}
Also used : RefreshAttributesPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshAttributesPanelEvent) RefreshMetaDataPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshMetaDataPanelEvent) RefreshConditionsPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent) RefreshActionsPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshActionsPanelEvent)

Example 2 with RefreshConditionsPanelEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent in project drools-wb by kiegroup.

the class ColumnsPagePresenterTest method testOnRefreshConditionsPanelEvent.

@Test
public void testOnRefreshConditionsPanelEvent() {
    final RefreshConditionsPanelEvent event = mock(RefreshConditionsPanelEvent.class);
    final GuidedDecisionTableView.Presenter eventPresenter = mock(GuidedDecisionTableView.Presenter.class);
    final List<CompositeColumn<? extends BaseColumn>> columns = new ArrayList<>();
    doReturn(eventPresenter).when(event).getPresenter();
    doReturn(columns).when(event).getColumns();
    doNothing().when(presenter).refreshConditionsWidget(any());
    doNothing().when(presenter).refreshColumnsNoteInfo(any());
    presenter.onRefreshConditionsPanelEvent(event);
    verify(presenter).refreshConditionsWidget(columns);
    verify(presenter).refreshColumnsNoteInfo(eventPresenter);
}
Also used : ArrayList(java.util.ArrayList) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) RefreshConditionsPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent) GuidedDecisionTableView(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView) CompositeColumn(org.drools.workbench.models.guided.dtable.shared.model.CompositeColumn) Test(org.junit.Test)

Example 3 with RefreshConditionsPanelEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenterTest method appendConditionColumn.

@Test
public void appendConditionColumn() throws VetoException {
    reset(modellerPresenter);
    final ConditionCol52 condition = new ConditionCol52();
    condition.setFactField("field");
    condition.setHeader("header");
    dtPresenter.appendColumn(condition);
    verify(synchronizer, times(1)).appendColumn(eq(condition));
    verify(refreshConditionsPanelEvent, times(1)).fire(any(RefreshConditionsPanelEvent.class));
    verify(modellerPresenter, times(1)).updateLinks();
}
Also used : ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) RefreshConditionsPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent) Test(org.junit.Test)

Example 4 with RefreshConditionsPanelEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenterTest method appendPatternAndConditionColumn.

@Test
public void appendPatternAndConditionColumn() throws VetoException {
    reset(modellerPresenter);
    final Pattern52 pattern = new Pattern52();
    pattern.setFactType("FactType");
    final ConditionCol52 condition = new ConditionCol52();
    condition.setFactField("field");
    condition.setHeader("header");
    dtPresenter.appendColumn(pattern, condition);
    verify(synchronizer, times(1)).appendColumn(eq(pattern), eq(condition));
    verify(refreshConditionsPanelEvent, times(1)).fire(any(RefreshConditionsPanelEvent.class));
    verify(modellerPresenter, times(1)).updateLinks();
}
Also used : ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) RefreshConditionsPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent) Test(org.junit.Test)

Aggregations

RefreshConditionsPanelEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent)4 Test (org.junit.Test)3 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)2 ArrayList (java.util.ArrayList)1 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)1 CompositeColumn (org.drools.workbench.models.guided.dtable.shared.model.CompositeColumn)1 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)1 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)1 RefreshActionsPanelEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshActionsPanelEvent)1 RefreshAttributesPanelEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshAttributesPanelEvent)1 RefreshMetaDataPanelEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshMetaDataPanelEvent)1