use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools-wb by kiegroup.
the class FactPatternConstraintsPageViewImpl method makeDefaultValueWidget.
private void makeDefaultValueWidget() {
DTCellValue52 defaultValue = chosenConditionsSelection.getDefaultValue();
if (defaultValue == null) {
defaultValue = factory.makeNewValue(chosenConditionsSelection);
chosenConditionsSelection.setDefaultValue(defaultValue);
}
// Correct comma-separated Default Value if operator does not support it
if (!validator.doesOperatorAcceptCommaSeparatedValues(chosenConditionsSelection)) {
cellUtilities.removeCommaSeparatedValue(defaultValue);
}
defaultValueWidgetContainer.setWidget(factory.getWidget(availablePatternsSelection, chosenConditionsSelection, defaultValue));
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools-wb by kiegroup.
the class ActionSetFieldsPage method assertDefaultValue.
@Override
public void assertDefaultValue(final Pattern52 selectedPattern, final ActionSetFieldCol52 selectedAction) {
final List<String> valueList = Arrays.asList(columnUtilities.getValueList(selectedAction));
if (valueList.size() > 0) {
final String defaultValue = cellUtilities.asString(selectedAction.getDefaultValue());
if (!valueList.contains(defaultValue)) {
selectedAction.getDefaultValue().clearValues();
}
} else {
// Ensure the Default Value has been updated to represent the column's data-type.
final DTCellValue52 defaultValue = selectedAction.getDefaultValue();
final DataType.DataTypes dataType = columnUtilities.getDataType(selectedPattern, selectedAction);
cellUtilities.convertDTCellValueType(dataType, defaultValue);
}
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools-wb by kiegroup.
the class RowExpander method addLimitedEntryColumn.
private void addLimitedEntryColumn(final ConditionCol52 c) {
final List<DTCellValue52> values = new ArrayList<DTCellValue52>();
values.add(new DTCellValue52(Boolean.TRUE));
values.add(new DTCellValue52(Boolean.FALSE));
final ColumnValues cv = new ColumnValues(columns, values, c.getDefaultValue());
this.expandedColumns.put(c, cv);
this.columns.add(cv);
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 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));
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools-wb by kiegroup.
the class RowSynchronizerTest method testMoveRowMoveUpMidBlock.
@Test
public void testMoveRowMoveUpMidBlock() throws VetoException {
modelSynchronizer.appendRow();
modelSynchronizer.appendRow();
modelSynchronizer.appendRow();
final GridRow uiRow0 = uiModel.getRow(0);
final GridRow uiRow1 = uiModel.getRow(1);
final GridRow uiRow2 = uiModel.getRow(2);
final List<DTCellValue52> row0 = model.getData().get(0);
final List<DTCellValue52> row1 = model.getData().get(1);
final List<DTCellValue52> row2 = model.getData().get(2);
uiModel.moveRowsTo(1, new ArrayList<GridRow>() {
{
add(uiRow2);
}
});
assertEquals(uiRow0, uiModel.getRow(0));
assertEquals(uiRow2, uiModel.getRow(1));
assertEquals(uiRow1, uiModel.getRow(2));
assertEquals(row0, model.getData().get(0));
assertEquals(row2, model.getData().get(1));
assertEquals(row1, model.getData().get(2));
}
Aggregations