}
if ( showLiteralOrFormula ) {
form.addAttribute( constants.LiteralValue() + ":",
widgets( lit,
new InfoPopup( constants.LiteralValue(),
constants.LiteralValTip() ) ) );
}
if ( modeller.isTemplate() ) {
String templateKeyLabel = constants.TemplateKey();
Button templateKeyButton = new Button( templateKeyLabel );
templateKeyButton.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_TEMPLATE );
doTypeChosen( form );
}
} );
form.addAttribute( templateKeyLabel + ":",
widgets( templateKeyButton,
new InfoPopup( templateKeyLabel,
constants.LiteralValTip() ) ) );
}
if ( showLiteralOrFormula ) {
form.addRow( new HTML( "<hr/>" ) );
form.addRow( new SmallLabel( constants.AdvancedOptions() ) );
}
//only want to show variables if we have some !
List<String> bindingsInScope = this.model.getBoundVariablesInScope( this.constraint );
if ( bindingsInScope.size() > 0
|| SuggestionCompletionEngine.TYPE_COLLECTION.equals( this.fieldType ) ) {
List<String> applicableBindingsInScope = getApplicableBindingsInScope( bindingsInScope );
if ( applicableBindingsInScope.size() > 0 ) {
Button variable = new Button( constants.BoundVariable() );
variable.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
con.setConstraintValueType( SingleFieldConstraint.TYPE_VARIABLE );
doTypeChosen( form );
}
} );
form.addAttribute( constants.AVariable(),
widgets( variable,
new InfoPopup( constants.ABoundVariable(),
constants.BoundVariableTip() ) ) );
}
}
if ( showLiteralOrFormula ) {
Button formula = new Button( constants.NewFormula() );
formula.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
con.setConstraintValueType( SingleFieldConstraint.TYPE_RET_VALUE );
doTypeChosen( form );
}
} );
form.addAttribute( constants.AFormula() + ":",
widgets( formula,
new InfoPopup( constants.AFormula(),
constants.FormulaExpressionTip() ) ) );
}
Button expression = new Button( constants.ExpressionEditor() );
expression.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
con.setConstraintValueType( SingleFieldConstraint.TYPE_EXPR_BUILDER_VALUE );
doTypeChosen( form );
}
} );
form.addAttribute( constants.ExpressionEditor() + ":",
widgets( expression,
new InfoPopup( constants.ExpressionEditor(),
constants.ExpressionEditor() ) ) );
form.show();
}