}
} );
form.addAttribute( Constants.INSTANCE.LiteralValue() + ":",
widgets( lit,
new InfoPopup( Constants.INSTANCE.Literal(),
Constants.INSTANCE.ALiteralValueMeansTheValueAsTypedInIeItsNotACalculation() ) ) );
if ( modeller.isTemplate() ) {
Button templateButton = new Button( Constants.INSTANCE.TemplateKey() );
templateButton.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
value.nature = FieldNature.TYPE_TEMPLATE;
value.value = "";
doTypeChosen( form );
}
} );
form.addAttribute( Constants.INSTANCE.TemplateKey() + ":",
widgets( templateButton,
new InfoPopup( Constants.INSTANCE.Literal(),
Constants.INSTANCE.ALiteralValueMeansTheValueAsTypedInIeItsNotACalculation() ) ) );
}
form.addRow( new HTML( "<hr/>" ) );
form.addRow( new SmallLabel( Constants.INSTANCE.AdvancedSection() ) );
Button formula = new Button( Constants.INSTANCE.Formula() );
formula.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
value.nature = FieldNature.TYPE_FORMULA;
value.value = "=";
doTypeChosen( form );
}
} );
// If there is a bound Facts or Fields that are of the same type as the current variable type, then show a button
List<String> bindings = getApplicableBindings();
if ( bindings.size() > 0 ) {
Button variable = new Button( Constants.INSTANCE.BoundVariable() );
form.addAttribute( Constants.INSTANCE.BoundVariable() + ":",
variable );
variable.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
value.nature = FieldNature.TYPE_VARIABLE;
value.value = "=";
doTypeChosen( form );
}
} );
}
form.addAttribute( Constants.INSTANCE.Formula() + ":",
widgets( formula,
new InfoPopup( Constants.INSTANCE.Formula(),
Constants.INSTANCE.FormulaTip() ) ) );
form.show();
}