form.hide();
}
private Widget boundVariable() {
// If there is a bound variable that is the same type of the current variable type, then display a list
ListBox listVariable = new ListBox();
listVariable.addItem( Constants.INSTANCE.Choose() );
List<String> bindings = getApplicableBindings();
for ( String v : bindings ) {
listVariable.addItem( v );
}
//Pre-select applicable item
if ( value.getValue().equals( "=" ) ) {
listVariable.setSelectedIndex( 0 );
} else {
for ( int i = 0; i < listVariable.getItemCount(); i++ ) {
if ( listVariable.getItemText( i ).equals( value.getValue().substring( 1 ) ) ) {
listVariable.setSelectedIndex( i );
}
}
}
//Add event handler
if ( listVariable.getItemCount() > 0 ) {
listVariable.addChangeHandler( new ChangeHandler() {
public void onChange( ChangeEvent event ) {
ListBox w = (ListBox) event.getSource();
value.setValue( "=" + w.getValue( w.getSelectedIndex() ) );
executeOnChangeCommand();
makeDirty();
refresh();
}
} );