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());
}
}
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);
}
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;
}
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();
}
}
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));
}
Aggregations