private Set<String> visitConnectiveConstraint(ConnectiveConstraint cc) { final Set<String> factTypes = new HashSet<String>(); if (cc.getFactType() != null) { factTypes.add(cc.getFactType()); } return factTypes; }
private Set<String> visitConnectiveConstraint(ConnectiveConstraint cc) { final Set<String> factTypes = new HashSet<String>(); if (cc.getFactType() != null) { factTypes.add(cc.getFactType()); } return factTypes; }
private void setUpConnectiveConstraint(ConnectiveConstraint cc) { this.factType = cc.getFactType(); this.fieldName = cc.getFieldName(); this.fieldType = cc.getFieldType(); }
private void setUpConnectiveConstraint(ConnectiveConstraint cc) { this.factType = cc.getFactType(); this.fieldName = cc.getFieldName(); this.fieldType = cc.getFieldType(); }
@Test public void testConnectiveOperatorsInteger() throws Exception { doReturn("org.Address").when(connectiveConstraint).getFactType(); doReturn("number").when(connectiveConstraint).getFieldName(); connectives.connectives(singleFieldConstraint); verify(connectives).getDropdown(OperatorsOracle.COMPARABLE_CONNECTIVES, connectiveConstraint); }
@Test public void testConnectiveOperatorsString() throws Exception { doReturn("org.Address").when(connectiveConstraint).getFactType(); doReturn("street").when(connectiveConstraint).getFieldName(); connectives.connectives(singleFieldConstraint); verify(connectives).getDropdown(OperatorsOracle.STRING_CONNECTIVES, connectiveConstraint); }
@Test public void testConnectiveOperatorsString() throws Exception { doReturn("org.Address").when(connectiveConstraint).getFactType(); doReturn("street").when(connectiveConstraint).getFieldName(); connectives.connectives(singleFieldConstraint); verify(connectives).getDropdown(OperatorsOracle.STRING_CONNECTIVES, connectiveConstraint); }
@Test public void testConnectiveOperatorsInteger() throws Exception { doReturn("org.Address").when(connectiveConstraint).getFactType(); doReturn("number").when(connectiveConstraint).getFieldName(); connectives.connectives(singleFieldConstraint); verify(connectives).getDropdown(OperatorsOracle.COMPARABLE_CONNECTIVES, connectiveConstraint); }
private void visitConnectiveConstraint(final ConnectiveConstraint cc) { ResourceReference resRef = addResourceReference(getFullyQualifiedClassName(cc.getFactType()), ResourceType.JAVA); resRef.addPartReference(cc.getFieldName(), PartType.FIELD); addResourceReference(getFullyQualifiedClassName(cc.getFieldType()), ResourceType.JAVA); }
private void visitConnectiveConstraint(final ConnectiveConstraint cc) { ResourceReference resRef = addResourceReference(getFullyQualifiedClassName(cc.getFactType()), ResourceType.JAVA); resRef.addPartReference(cc.getFieldName(), PartType.FIELD); addResourceReference(getFullyQualifiedClassName(cc.getFieldType()), ResourceType.JAVA); }
private ConnectiveConstraint visitConnectiveConstraint(ConnectiveConstraint cc) { ConnectiveConstraint clone = new ConnectiveConstraint(); clone.setConstraintValueType(cc.getConstraintValueType()); clone.setExpressionValue((ExpressionFormLine) visit(cc.getExpressionValue())); clone.setFactType(cc.getFactType()); clone.setFieldName(cc.getFieldName()); clone.setFieldType(cc.getFieldType()); clone.setOperator(cc.getOperator()); for (Map.Entry<String, String> entry : cc.getParameters().entrySet()) { clone.setParameter(entry.getKey(), entry.getValue()); } clone.setValue(cc.getValue()); return clone; }
private ConnectiveConstraint visitConnectiveConstraint(ConnectiveConstraint cc) { ConnectiveConstraint clone = new ConnectiveConstraint(); clone.setConstraintValueType(cc.getConstraintValueType()); clone.setExpressionValue((ExpressionFormLine) visit(cc.getExpressionValue())); clone.setFactType(cc.getFactType()); clone.setFieldName(cc.getFieldName()); clone.setFieldType(cc.getFieldType()); clone.setOperator(cc.getOperator()); for (Map.Entry<String, String> entry : cc.getParameters().entrySet()) { clone.setParameter(entry.getKey(), entry.getValue()); } clone.setValue(cc.getValue()); return clone; }
void connectiveOperatorDropDown(final ConnectiveConstraint cc, final Callback<Widget> callback) { if (!isReadOnly) { final String factType = cc.getFactType(); final String fieldName = cc.getFieldName(); this.getDataModelOracle().getConnectiveOperatorCompletions(factType, fieldName, new Callback<String[]>() { @Override public void callback(final String[] operators) { final CEPOperatorsDropdown dropdown = getDropdown(operators, cc); dropdown.addPlaceholder(GuidedRuleEditorResources.CONSTANTS.pleaseChoose(), ""); dropdown.addValueChangeHandler(new ValueChangeHandler<OperatorSelection>() { public void onValueChange(ValueChangeEvent<OperatorSelection> event) { OperatorSelection selection = event.getValue(); String selected = selection.getValue(); cc.setOperator(selected); } }); callback.callback(dropdown); } }); } else { final SmallLabel w = new SmallLabel("<b>" + (cc.getOperator() == null ? GuidedRuleEditorResources.CONSTANTS.pleaseChoose() : HumanReadable.getOperatorDisplayName(cc.getOperator())) + "</b>"); callback.callback(w); } }
void connectiveOperatorDropDown(final ConnectiveConstraint cc, final Callback<Widget> callback) { if (!isReadOnly) { final String factType = cc.getFactType(); final String fieldName = cc.getFieldName(); this.getDataModelOracle().getConnectiveOperatorCompletions(factType, fieldName, new Callback<String[]>() { @Override public void callback(final String[] operators) { final CEPOperatorsDropdown dropdown = getDropdown(operators, cc); dropdown.addPlaceholder(GuidedRuleEditorResources.CONSTANTS.pleaseChoose(), ""); dropdown.addValueChangeHandler(new ValueChangeHandler<OperatorSelection>() { public void onValueChange(ValueChangeEvent<OperatorSelection> event) { OperatorSelection selection = event.getValue(); String selected = selection.getValue(); cc.setOperator(selected); } }); callback.callback(dropdown); } }); } else { final SmallLabel w = new SmallLabel("<b>" + (cc.getOperator() == null ? GuidedRuleEditorResources.CONSTANTS.pleaseChoose() : HumanReadable.getOperatorDisplayName(cc.getOperator())) + "</b>"); callback.callback(w); } }