}
} );
form.addAttribute( GuidedRuleEditorResources.CONSTANTS.LiteralValue() + ":",
widgets( lit,
new InfoPopup( GuidedRuleEditorResources.CONSTANTS.Literal(),
GuidedRuleEditorResources.CONSTANTS.ALiteralValueMeansTheValueAsTypedInIeItsNotACalculation() ) ) );
if ( modeller.isTemplate() ) {
Button templateButton = new Button( GuidedRuleEditorResources.CONSTANTS.TemplateKey() );
templateButton.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent event ) {
value.setNature( FieldNatureType.TYPE_TEMPLATE );
value.setValue( "" );
doTypeChosen( form );
}
} );
form.addAttribute( GuidedRuleEditorResources.CONSTANTS.TemplateKey() + ":",
widgets( templateButton,
new InfoPopup( GuidedRuleEditorResources.CONSTANTS.Literal(),
GuidedRuleEditorResources.CONSTANTS.ALiteralValueMeansTheValueAsTypedInIeItsNotACalculation() ) ) );
}
form.addRow( new HTML( "<hr/>" ) );
form.addRow( new SmallLabel( GuidedRuleEditorResources.CONSTANTS.AdvancedSection() ) );
Button formula = new Button( GuidedRuleEditorResources.CONSTANTS.Formula() );
formula.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent event ) {
value.setNature( FieldNatureType.TYPE_FORMULA );
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( GuidedRuleEditorResources.CONSTANTS.BoundVariable() );
form.addAttribute( GuidedRuleEditorResources.CONSTANTS.BoundVariable() + ":",
variable );
variable.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent event ) {
value.setNature( FieldNatureType.TYPE_VARIABLE );
value.setValue( "=" );
doTypeChosen( form );
}
} );
}
form.addAttribute( GuidedRuleEditorResources.CONSTANTS.Formula() + ":",
widgets( formula,
new InfoPopup( GuidedRuleEditorResources.CONSTANTS.Formula(),
GuidedRuleEditorResources.CONSTANTS.FormulaTip() ) ) );
form.show();
}