use of org.kie.workbench.common.dmn.api.definition.model.BuiltinAggregator in project kie-wb-common by kiegroup.
the class HitPolicyPopoverViewImpl method setupBuiltinAggregatorEventHandler.
private void setupBuiltinAggregatorEventHandler() {
setupChangeEventHandler(lstBuiltinAggregator, () -> {
final BuiltinAggregator aggregator = builtinAggregatorUtils.toEnum(lstBuiltinAggregator.getValue());
presenter.setBuiltinAggregator(aggregator);
});
}
use of org.kie.workbench.common.dmn.api.definition.model.BuiltinAggregator in project kie-wb-common by kiegroup.
the class RowNumberColumnHeaderMetaData method getTitle.
@Override
public String getTitle() {
final HitPolicy hitPolicy = hitPolicySupplier.get();
final BuiltinAggregator builtinAggregator = builtinAggregatorSupplier.get();
final StringBuilder sb = new StringBuilder(hitPolicy.value().substring(0, 1).toUpperCase());
if (HitPolicy.COLLECT == hitPolicy) {
if (builtinAggregator != null) {
sb.append(builtinAggregator.getCode());
}
}
return sb.toString();
}
use of org.kie.workbench.common.dmn.api.definition.model.BuiltinAggregator in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testSetBuiltInAggregator.
@Test
public void testSetBuiltInAggregator() {
final BuiltinAggregator aggregator = BuiltinAggregator.SUM;
setupGrid(makeHasNameForDecision(), 0);
grid.setBuiltinAggregator(aggregator);
verify(sessionCommandManager).execute(eq(canvasHandler), setBuiltInAggregatorCommandCaptor.capture());
final SetBuiltinAggregatorCommand setBuiltinAggregatorCommand = setBuiltInAggregatorCommandCaptor.getValue();
setBuiltinAggregatorCommand.execute(canvasHandler);
verify(gridLayer).batch();
}
use of org.kie.workbench.common.dmn.api.definition.model.BuiltinAggregator in project kie-wb-common by kiegroup.
the class HitPolicyPopoverImplTest method testSetBuiltInAggregatorNonNullControl.
@Test
public void testSetBuiltInAggregatorNonNullControl() {
final BuiltinAggregator aggregator = BuiltinAggregator.COUNT;
when(control.getBuiltinAggregator()).thenReturn(aggregator);
editor.bind(control, UI_ROW_INDEX, UI_COLUMN_INDEX);
reset(view);
editor.setBuiltinAggregator(aggregator);
verify(control).setBuiltinAggregator(eq(aggregator));
}
Aggregations