protected void showTypeChoice(Widget w) {
final FormStylePopup form = new FormStylePopup( images.newexWiz(),
constants.FieldValue() );
Button lit = new Button( constants.LiteralValue() );
lit.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
methodParameter.nature = FieldNature.TYPE_LITERAL;
methodParameter.value = " ";
makeDirty();
refresh();
form.hide();
}
} );
form.addAttribute( constants.LiteralValue() + ":",
widgets( lit,
new InfoPopup( constants.Literal(),
constants.LiteralValTip() ) ) );
form.addRow( new HTML( "<hr/>" ) );
form.addRow( new SmallLabel( constants.AdvancedSection() ) );
/*
* If there is a bound variable that is the same type of the current
* variable type, then show abutton
*/
List<String> vars = model.getFactNamesInScope( ex,
true );
for ( String v : vars ) {
boolean createButton = false;
Button variable = new Button( constants.BoundVariable() );
FactData factData = (FactData) model.getFactTypes().get( v );
if ( factData.getType().equals( this.parameterType ) ) {
createButton = true;
}
if ( createButton == true ) {
form.addAttribute( constants.BoundVariable() + ":",
variable );
variable.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
methodParameter.nature = FieldNature.TYPE_VARIABLE;
methodParameter.value = "=";
makeDirty();