use of org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52 in project drools-wb by kiegroup.
the class PluginHandlerTest method testEditWhenColumnIsAnActionSetFieldCol52.
@Test
public void testEditWhenColumnIsAnActionSetFieldCol52() {
final ActionSetFieldCol52 originalColumn = mock(ActionSetFieldCol52.class);
final ActionSetFactPlugin plugin = spy(new ActionSetFactPlugin(patternPage, fieldPage, valueOptionsPage, additionalInfoPage, event, translationService));
testEditActionColumn(plugin, actionSetFactPlugin, originalColumn);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52 in project drools-wb by kiegroup.
the class ActionSetFactWrapper method clone.
private ActionSetFieldCol52 clone(final ActionSetFieldCol52 column) {
final ActionSetFieldCol52 clone = newActionSetField();
if (tableFormat() == LIMITED_ENTRY) {
asLimited(clone).setValue(asLimited(column).getValue());
}
clone.setFactField(column.getFactField());
clone.setBoundName(column.getBoundName());
clone.setValueList(column.getValueList());
clone.setHeader(column.getHeader());
clone.setUpdate(column.isUpdate());
clone.setDefaultValue(column.getDefaultValue());
clone.setHideColumn(column.isHideColumn());
clone.setType(column.getType());
return clone;
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52 in project drools-wb by kiegroup.
the class DefaultWidgetFactory method makeNewValue.
private DTCellValue52 makeNewValue() {
final DTColumnConfig52 column = getPlugin().editingCol();
final Pattern52 pattern = getPlugin().editingPattern();
if (column instanceof ActionSetFieldCol52) {
return factory().makeNewValue(pattern, (ActionSetFieldCol52) column);
} else if (column instanceof ConditionCol52) {
return factory().makeNewValue(pattern, (ConditionCol52) column);
} else {
return factory().makeNewValue(column);
}
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52 in project drools-wb by kiegroup.
the class DefaultWidgetFactory method getWidget.
private Widget getWidget(final DTCellValue52 defaultValue) {
final DTColumnConfig52 column = getPlugin().editingCol();
final Pattern52 pattern = getPlugin().editingPattern();
if (column instanceof ActionSetFieldCol52) {
final ActionSetFieldCol52 col52 = (ActionSetFieldCol52) column;
return factory().getWidget(pattern, col52, defaultValue);
} else if (column instanceof ConditionCol52) {
final ConditionCol52 col52 = (ConditionCol52) column;
return factory().getWidget(pattern, col52, defaultValue);
} else if (column instanceof ActionInsertFactCol52) {
final ActionInsertFactCol52 col52 = (ActionInsertFactCol52) column;
return factory().getWidget(col52, defaultValue);
}
throw new UnsupportedOperationException("The column type is not supported by the 'DefaultWidget'");
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52 in project drools-wb by kiegroup.
the class ActionSetFieldsPage method initialise.
@Override
public void initialise() {
view.init(this);
view.setValidator(getValidator());
patternToActionsMap.clear();
// Set-up validator for the pattern-to-action mapping voodoo
getValidator().setPatternToActionSetFieldsMap(patternToActionsMap);
// Set-up a factory for value editors
view.setDTCellValueWidgetFactory(DTCellValueWidgetFactory.getInstance(model, oracle, false, allowEmptyValues()));
// Existing ActionSetFieldCols (should be empty for a new Decision Table)
for (ActionCol52 a : model.getActionCols()) {
if (a instanceof ActionSetFieldCol52) {
final ActionSetFieldCol52 asf = (ActionSetFieldCol52) a;
final Pattern52 p = model.getConditionPattern(asf.getBoundName());
if (!patternToActionsMap.containsKey(p)) {
patternToActionsMap.put(p, new ArrayList<ActionSetFieldCol52>());
}
final List<ActionSetFieldCol52> actions = patternToActionsMap.get(p);
actions.add(asf);
}
}
view.setChosenFields(new ArrayList<ActionSetFieldCol52>());
content.setWidget(view);
}
Aggregations