use of org.activityinfo.model.formula.simple.SimpleCondition in project activityinfo by bedatadriven.
the class RelevancePanel method init.
public void init(List<FormField> fields, SimpleConditionList model) {
assert rows.isEmpty();
this.selectableFields = new ArrayList<>();
for (FormField field : fields) {
if (!SimpleOperators.forType(field.getType()).isEmpty()) {
selectableFields.add(field);
}
}
if (model.getCriteria() == Criteria.ALL_TRUE) {
criteriaListBox.setSelectedIndex(ALL_INDEX);
} else {
criteriaListBox.setSelectedIndex(ANY_INDEX);
}
for (SimpleCondition condition : model.getConditions()) {
addRow(Optional.of(condition));
}
if (rows.isEmpty()) {
addRow(Optional.<SimpleCondition>absent());
}
onRowCountUpdated();
}
Aggregations