Search in sources :

Example 1 with RefreshAttributesPanelEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshAttributesPanelEvent 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 RefreshAttributesPanelEvent

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

the class ColumnsPagePresenterTest method testOnRefreshAttributesPanelEvent.

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

Example 3 with RefreshAttributesPanelEvent

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

the class GuidedDecisionTablePresenterAttributesAndMetadataTest method appendAttributeColumn.

@Test
public void appendAttributeColumn() throws VetoException {
    reset(modellerPresenter);
    final AttributeCol52 column = new AttributeCol52();
    column.setAttribute(RuleAttributeWidget.AUTO_FOCUS_ATTR);
    dtPresenter.appendColumn(column);
    verify(synchronizer, times(1)).appendColumn(eq(column));
    verify(refreshAttributesPanelEvent, times(1)).fire(any(RefreshAttributesPanelEvent.class));
    verify(modellerPresenter, times(1)).updateLinks();
}
Also used : AttributeCol52(org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52) RefreshAttributesPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshAttributesPanelEvent) Test(org.junit.Test)

Example 4 with RefreshAttributesPanelEvent

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

the class GuidedDecisionTablePresenterTest method deleteAttributeColumn.

@Test
public void deleteAttributeColumn() throws Exception {
    final AttributeCol52 column = new AttributeCol52();
    column.setAttribute("salience");
    dtPresenter.appendColumn(column);
    reset(modellerPresenter);
    dtPresenter.deleteColumn(column);
    verify(synchronizer, times(1)).deleteColumn(eq(column));
    verify(modellerPresenter, times(1)).updateLinks();
    verify(refreshAttributesPanelEvent, times(2)).fire(any(RefreshAttributesPanelEvent.class));
    checkDTSelectionsChangedEventFired(1);
}
Also used : AttributeCol52(org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52) RefreshAttributesPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshAttributesPanelEvent) Test(org.junit.Test)

Aggregations

RefreshAttributesPanelEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshAttributesPanelEvent)4 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)3 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)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 RefreshConditionsPanelEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshConditionsPanelEvent)1 RefreshMetaDataPanelEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshMetaDataPanelEvent)1