this.model = set;
this.layout = new DirtyableFlexTable();
layout.setStyleName( "model-builderInner-Background" );
SuggestionCompletionEngine completions = this.getModeller().getSuggestionCompletions();
if ( completions.isGlobalVariable( set.variable ) ) {
this.fieldCompletions = completions.getFieldCompletionsForGlobalVariable( set.variable );
this.variableClass = completions.getGlobalVariable( set.variable );
} else {
String type = mod.getModel().getLHSBindingType( set.variable );
if ( type != null ) {
this.fieldCompletions = completions.getFieldCompletions( FieldAccessorsAndMutators.MUTATOR,
type );
this.variableClass = type;
this.isBoundFact = true;
} else {
ActionInsertFact patternRhs = mod.getModel().getRHSBoundFact( set.variable );
if ( patternRhs != null ) {
this.fieldCompletions = completions.getFieldCompletions( FieldAccessorsAndMutators.MUTATOR,
patternRhs.factType );
this.variableClass = patternRhs.factType;
this.isBoundFact = true;
}
}
}
if ( this.variableClass == null ) {
throw new IllegalStateException( "couldn't find type for variable: " + set.variable );
}
if ( readOnly == null ) {
this.readOnly = !completions.containsFactType( this.variableClass );
} else {
this.readOnly = readOnly;
}
if ( this.readOnly ) {