private boolean isTemplateKey(final FieldConstraint nestedConstr) { return nestedConstr instanceof BaseSingleFieldConstraint && ((BaseSingleFieldConstraint) nestedConstr).getConstraintValueType() == BaseSingleFieldConstraint.TYPE_TEMPLATE; }
public void onClick(ClickEvent event) { //Reset Constraint's value and value type if (Window.confirm(GuidedRuleEditorResources.CONSTANTS.RemoveConstraintValueDefinitionQuestion())) { constraint.setConstraintValueType(BaseSingleFieldConstraint.TYPE_UNDEFINED); constraint.setValue(null); constraint.clearParameters(); constraint.setExpressionValue(new ExpressionFormLine()); doTypeChosen(); } } });
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; ConnectiveConstraint that = (ConnectiveConstraint) o; if (factType != null ? !factType.equals(that.factType) : that.factType != null) return false; if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) return false; if (fieldType != null ? !fieldType.equals(that.fieldType) : that.fieldType != null) return false; return true; }
String value) { if (value.contains("@{")) { con.setConstraintValueType(BaseSingleFieldConstraint.TYPE_TEMPLATE); con.setValue(unwrapTemplateKey(value)); } else if (value.startsWith("\"")) { con.setConstraintValueType(SingleFieldConstraint.TYPE_LITERAL); con.setValue(value.substring(1, value.length() - 1)); } else if (value.startsWith("(")) { if (operator != null && operator.contains("in")) { con.setConstraintValueType(SingleFieldConstraint.TYPE_LITERAL); con.setValue(unwrapParenthesis(value)); } else { con.setConstraintValueType(SingleFieldConstraint.TYPE_RET_VALUE); con.setValue(unwrapParenthesis(value)); con.setConstraintValueType(BaseSingleFieldConstraint.TYPE_ENUM); } else if (RuleModelPersistenceHelper.isEnumerationValue(m, factPattern, con, dmo)) { con.setConstraintValueType(SingleFieldConstraint.TYPE_ENUM); } else if (value.indexOf('.') > 0 && boundParams.containsKey(value.substring(0, value.indexOf('.')).trim())) { con.setExpressionValue(parseExpression(m, null, value, new ExpressionFormLine())); con.setConstraintValueType(BaseSingleFieldConstraint.TYPE_EXPR_BUILDER_VALUE);
@Override public void callback(final Boolean result) { if (Boolean.TRUE.equals(result)) { if (CEPOracle.isCEPOperator(constraint.getOperator())) { callback.callback(true); return; } } } });
final String operator = constraint.getOperator(); final boolean multipleSelect = OperatorsOracle.operatorRequiresList(operator); EnumDropDown enumDropDown = new EnumDropDown(constraint.getValue(), new DropDownValueChanged() { boolean isCEPOperator = CEPOracle.isCEPOperator((this.constraint).getOperator()); if (DataType.TYPE_DATE.equals(this.fieldType) || (DataType.TYPE_THIS.equals(this.fieldName) && isCEPOperator)) { if (this.readOnly) { return new SmallLabel(constraint.getValue());
@Override public void onClick(ClickEvent event) { con.setConstraintValueType(type); doTypeChosen(form); } };
@Override public int hashCode() { int result = super.hashCode(); result = ~~result; result = 31 * result + (factType != null ? factType.hashCode() : 0); result = ~~result; result = 31 * result + (fieldName != null ? fieldName.hashCode() : 0); result = ~~result; result = 31 * result + (fieldType != null ? fieldType.hashCode() : 0); result = ~~result; return result; } }
private Widget expressionEditor() { ExpressionBuilder builder = null; builder = new ExpressionBuilder(this.modeller, this.eventBus, this.constraint.getExpressionValue(), this.readOnly); builder.addOnModifiedCommand(new Command() { public void execute() { executeOnValueChangeCommand(); } }); Widget ed = widgets(new HTML(" "), builder); return ed; }
@Override public void callback(final Boolean result) { if (Boolean.TRUE.equals(result)) { if (CEPOracle.isCEPOperator(constraint.getOperator())) { callback.callback(true); return; } } } });
final String operator = constraint.getOperator(); final boolean multipleSelect = OperatorsOracle.operatorRequiresList(operator); EnumDropDown enumDropDown = new EnumDropDown(constraint.getValue(), new DropDownValueChanged() { boolean isCEPOperator = CEPOracle.isCEPOperator((this.constraint).getOperator()); if (DataType.TYPE_DATE.equals(this.fieldType) || (DataType.TYPE_THIS.equals(this.fieldName) && isCEPOperator)) { if (this.readOnly) { return new SmallLabel(constraint.getValue());
@Override public void onClick(ClickEvent event) { con.setConstraintValueType(type); doTypeChosen(form); } };
@Override public int hashCode() { int result = super.hashCode(); result = ~~result; result = 31 * result + (fieldBinding != null ? fieldBinding.hashCode() : 0); result = ~~result; result = 31 * result + (factType != null ? factType.hashCode() : 0); result = ~~result; result = 31 * result + (fieldName != null ? fieldName.hashCode() : 0); result = ~~result; result = 31 * result + (fieldType != null ? fieldType.hashCode() : 0); result = ~~result; result = 31 * result + (parent != null ? parent.hashCode() : 0); result = ~~result; result = 31 * result + (id != null ? id.hashCode() : 0); result = ~~result; result = 31 * result + (connectives != null ? Arrays.hashCode(connectives) : 0); result = ~~result; return result; } }
private Widget expressionEditor() { ExpressionBuilder builder = null; builder = new ExpressionBuilder(this.modeller, this.eventBus, this.constraint.getExpressionValue(), this.readOnly); builder.addOnModifiedCommand(new Command() { public void execute() { executeOnValueChangeCommand(); } }); Widget ed = widgets(new HTML(" "), builder); return ed; }