use of org.drools.workbench.screens.guided.rule.client.editor.ExpressionTypeChangeEvent in project drools-wb by kiegroup.
the class FactPatternWidget method associateExpressionWithChangeHandler.
private void associateExpressionWithChangeHandler(final FlexTable inner, final int row, final SingleFieldConstraint constraint, final int col, HorizontalPanel ebContainer) {
ExpressionBuilder eb = (ExpressionBuilder) ebContainer.getWidget(0);
eb.addExpressionTypeChangeHandler(new ExpressionTypeChangeHandler() {
public void onExpressionTypeChanged(ExpressionTypeChangeEvent event) {
try {
// Change "operator" drop-down as the content depends on data-type
constraint.setFieldType(event.getNewType());
inner.setWidget(row, 1 + col, operatorDropDown(constraint, inner, row, 2 + col));
// Change "value" editor to the pen icon as the applicable Widget depends on data-type
constraint.setConstraintValueType(SingleFieldConstraint.TYPE_UNDEFINED);
constraint.setValue("");
inner.setWidget(row, 2 + col, createValueEditor(constraint));
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
Aggregations