private boolean isRHSFieldTypeEquivalent( String boundVariable ) { String boundFactType = modeller.getModel().getRHSBoundFact( boundVariable ).getFactType(); if ( boundFactType == null ) { return false; } if ( this.variableType == null ) { return false; } //If the types are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent if ( boundFactType.equals( DataType.TYPE_COMPARABLE ) ) { if ( !this.variableType.equals( DataType.TYPE_COMPARABLE ) ) { return false; } String[] dd = this.modeller.getSuggestionCompletions().getEnumValues( boundFactType, this.value.getField() ); return isEnumEquivalent( dd ); } //If the types are identical (and not SuggestionCompletionEngine.TYPE_COMPARABLE) then return true if ( boundFactType.equals( this.variableType ) ) { return true; } return false; }
ActionInsertFact factPattern = model.getModel().getRHSBoundFact( v ); if ( factPattern.getFactType().equals( this.methodParameter.getType() ) ) {
ActionInsertFact factPattern = model.getModel().getRHSBoundFact( v ); if ( factPattern.getFactType().equals( this.parameterType ) ) { createButton = true;
private List<String> getApplicableBindings() { List<String> bindings = new ArrayList<String>(); //Examine LHS Fact and Field bindings and RHS (new) Fact bindings for ( String v : modeller.getModel().getAllVariables() ) { //LHS FactPattern FactPattern fp = modeller.getModel().getLHSBoundFact( v ); if ( fp != null ) { if ( isLHSFactTypeEquivalent( v ) ) { bindings.add( v ); } } //LHS FieldConstraint FieldConstraint fc = modeller.getModel().getLHSBoundField( v ); if ( fc != null ) { if ( isLHSFieldTypeEquivalent( v ) ) { bindings.add( v ); } } //RHS ActionInsertFact ActionInsertFact aif = modeller.getModel().getRHSBoundFact( v ); if ( aif != null ) { if ( isRHSFieldTypeEquivalent( v ) ) { bindings.add( v ); } } } return bindings; }
ActionInsertFact patternRhs = mod.getModel().getRHSBoundFact( set.getVariable() ); if ( patternRhs != null ) { List<String> methodList = completions.getMethodNames( patternRhs.getFactType() );
private Widget valueEditor( final ActionFieldFunction val ) { DataModelOracle completions = this.getModeller().getSuggestionCompletions(); String type = ""; if ( completions.isGlobalVariable( this.model.getVariable() ) ) { type = completions.getGlobalVariable( this.model.getVariable() ); } else { type = this.getModeller().getModel().getLHSBindingType( this.model.getVariable() ); if ( type == null ) { type = this.getModeller().getModel().getRHSBoundFact( this.model.getVariable() ).getFactType(); } } DropDownData enums = completions.getEnums( type, val.getField(), FieldNatureUtil.toMap( this.model.getFieldValues() ) ); return new MethodParameterValueEditor( val, enums, this.getModeller(), val.getType(), new Command() { public void execute() { setModified( true ); } } ); }
private Widget valueEditor( final ActionFieldValue val ) { DataModelOracle completions = this.getModeller().getSuggestionCompletions(); String type = ""; if ( completions.isGlobalVariable( this.model.getVariable() ) ) { type = completions.getGlobalVariable( this.model.getVariable() ); } else { type = this.getModeller().getModel().getLHSBindingType( this.model.getVariable() ); /* * to take in account if the using a rhs bound variable */ if ( type == null && !this.readOnly ) { type = this.getModeller().getModel().getRHSBoundFact( this.model.getVariable() ).getFactType(); } } DropDownData enums = completions.getEnums( type, val.getField(), FieldNatureUtil.toMap( this.model.getFieldValues() ) ); ActionValueEditor actionValueEditor = new ActionValueEditor( val, enums, this.getModeller(), this.getEventBus(), val.getType(), this.readOnly ); actionValueEditor.setOnChangeCommand( new Command() { public void execute() { setModified( true ); } } ); return actionValueEditor; }
this.isBoundFact = true; } else { ActionInsertFact patternRhs = mod.getModel().getRHSBoundFact( set.getVariable() ); if ( patternRhs != null ) { this.fieldCompletions = completions.getFieldCompletions( FieldAccessorsAndMutators.MUTATOR,