Search in sources :

Example 21 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenter_AuditLogTest method updateColumnAddsToLog.

@Test
public void updateColumnAddsToLog() throws VetoException {
    dtPresenter.updateColumn(new ActionCol52(), new ActionCol52());
    dtPresenter.updateColumn(new AttributeCol52(), new AttributeCol52());
    dtPresenter.updateColumn(new ConditionCol52(), new ConditionCol52());
    dtPresenter.updateColumn(new MetadataCol52(), new MetadataCol52());
    dtPresenter.updateColumn(new Pattern52(), new ConditionCol52(), new Pattern52(), new ConditionCol52());
    verify(synchronizer, times(4)).updateColumn(any(BaseColumn.class), any(BaseColumn.class));
    verify(synchronizer).updateColumn(any(Pattern52.class), any(ConditionCol52.class), any(Pattern52.class), any(ConditionCol52.class));
    verify(model, times(5)).getAuditLog();
    assertEquals(5, model.getAuditLog().size());
    for (UpdateColumnAuditLogEntry entry : model.getAuditLog().toArray(new UpdateColumnAuditLogEntry[0])) {
        assertEquals(diffs, entry.getDiffs());
    }
}
Also used : AttributeCol52(org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52) MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) ActionCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionCol52) UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) Test(org.junit.Test)

Example 22 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class MetaDataColumnConverterTest method convert.

@Test
public void convert() throws Exception {
    final MetadataCol52 metadataCol = new MetadataCol52();
    metadataCol.setMetadata("hello");
    final GridColumn<?> column = metaDataColumnConverter.convertColumn(metadataCol, mock(GuidedDecisionTablePresenter.Access.class), mock(GuidedDecisionTableView.class));
    assertTrue(column instanceof StringUiColumn);
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) StringUiColumn(org.drools.workbench.screens.guided.dtable.client.widget.table.columns.StringUiColumn) GuidedDecisionTableView(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView) Test(org.junit.Test)

Example 23 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class MetaDataColumnPlugin method metadataColumn.

private MetadataCol52 metadataColumn() {
    final MetadataCol52 column = new MetadataCol52();
    column.setMetadata(metaData);
    column.setHideColumn(true);
    return column;
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)

Example 24 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class NewGuidedDecisionTableWizard method setContent.

public void setContent(final Path contextPath, final String baseFileName, final GuidedDecisionTable52.TableFormat tableFormat, final GuidedDecisionTable52.HitPolicy hitPolicy, final AsyncPackageDataModelOracle oracle, final GuidedDecisionTableWizardHandler handler) {
    this.model = new GuidedDecisionTable52();
    this.model.setTableFormat(tableFormat);
    this.model.setHitPolicy(hitPolicy);
    if (GuidedDecisionTable52.HitPolicy.RESOLVED_HIT.equals(hitPolicy)) {
        final MetadataCol52 metadataCol52 = new MetadataCol52();
        metadataCol52.setMetadata(GuidedDecisionTable52.HitPolicy.RESOLVED_HIT_METADATA_NAME);
        this.model.getMetadataCols().add(metadataCol52);
    }
    this.contextPath = contextPath;
    this.oracle = oracle;
    this.handler = handler;
    final Validator validator = new Validator(model.getConditions());
    for (WizardPage page : pages) {
        final AbstractGuidedDecisionTableWizardPage dtp = (AbstractGuidedDecisionTableWizardPage) page;
        dtp.setContent(contextPath, baseFileName, tableFormat, hitPolicy, oracle, model, validator);
        dtp.initialise();
    }
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) AbstractGuidedDecisionTableWizardPage(org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.AbstractGuidedDecisionTableWizardPage) WizardPage(org.uberfire.ext.widgets.core.client.wizards.WizardPage) AbstractGuidedDecisionTableWizardPage(org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.AbstractGuidedDecisionTableWizardPage) Validator(org.drools.workbench.screens.guided.dtable.client.widget.Validator)

Example 25 with MetadataCol52

use of org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52 in project drools-wb by kiegroup.

the class CellContextMenuTest method testOnDecisionTableSelectionsChangedEventWithSelectionsWithClipboardPopulated.

@Test
public void testOnDecisionTableSelectionsChangedEventWithSelectionsWithClipboardPopulated() {
    model.getMetadataCols().add(new MetadataCol52());
    model.getData().add(new ArrayList<DTCellValue52>() {

        {
            add(new DTCellValue52(1));
            add(new DTCellValue52("descr"));
            add(new DTCellValue52("md"));
        }
    });
    uiModel.selectCell(0, 2);
    clipboard.setData(new HashSet<Clipboard.ClipboardData>() {

        {
            add(new DefaultClipboard.ClipboardDataImpl(0, 2, model.getData().get(0).get(2)));
        }
    });
    menu.onDecisionTableSelectionsChangedEvent(new DecisionTableSelectionsChangedEvent(dtPresenter));
    verify(view, times(1)).enableCutMenuItem(eq(true));
    verify(view, times(1)).enableCopyMenuItem(eq(true));
    verify(view, times(1)).enablePasteMenuItem(eq(true));
    verify(view, times(1)).enableDeleteCellMenuItem(eq(true));
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) DecisionTableSelectionsChangedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectionsChangedEvent) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) Test(org.junit.Test)

Aggregations

MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)67 Test (org.junit.Test)52 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)18 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)12 ArrayList (java.util.ArrayList)11 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)10 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)10 DescriptionCol52 (org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52)9 RowNumberCol52 (org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52)9 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)8 DecisionTableSelectionsChangedEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectionsChangedEvent)8 DecisionTableSelectedEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent)7 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)6 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)6 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)5 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)5 GuidedDTTemplateDataProvider (org.drools.workbench.models.guided.dtable.backend.util.GuidedDTTemplateDataProvider)4 TemplateDataProvider (org.drools.workbench.models.guided.dtable.backend.util.TemplateDataProvider)4 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)4 CompositeColumn (org.drools.workbench.models.guided.dtable.shared.model.CompositeColumn)4