return clickme;
}
}
protected void showTypeChoice( Widget w ) {
final FormStylePopup form = new FormStylePopup( GuidedRuleEditorImages508.INSTANCE.Wizard(),
Constants.INSTANCE.FieldValue() );
Button lit = new Button( Constants.INSTANCE.LiteralValue() );
lit.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent event ) {
value.setNature( FieldNatureType.TYPE_LITERAL );
value.setValue( "" );
doTypeChosen( form );
}
} );
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.setNature( FieldNatureType.TYPE_TEMPLATE );
value.setValue( "" );
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.setNature( FieldNatureType.TYPE_FORMULA );
value.setValue( "=" );
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.setNature( FieldNatureType.TYPE_VARIABLE );
value.setValue( "=" );
doTypeChosen( form );
}
} );
}
form.addAttribute( Constants.INSTANCE.Formula() + ":",
widgets( formula,
new InfoPopup( Constants.INSTANCE.Formula(),
Constants.INSTANCE.FormulaTip() ) ) );
form.show();
}