String textData = configParams.get(ValidatorDefinition.EXPRESSION_PARAM_NAME);
if (textData == null) {
textData = "";
}
try {
Expr expr = BSHValidationModel.fromCode(textData, allVariables);
if (expr != null) {
Variable variable = expr.getVar1();
if (variableNames.contains(variable.getName())) {
comboBoxVar1.setText(variable.getName());
comboBoxVar1.setData(variable);
refreshCombos();
comboBoxOp.setText(expr.getOperation().getVisibleName());
comboBoxVar2.setText(expr.getVar2().getName());
textData = expr.generateCode();
}
}
} catch (Exception e) {
tabFolder.setSelection(1);
}