for ( int i = 0; i < sce.getFactTypes().length; i++ ) {
types.addItem( sce.getFactTypes()[i] );
}
pop.addAttribute( constants.FactType(),
types );
final TextBox binding = new BindingTextBox();
binding.addChangeHandler( new ChangeHandler() {
public void onChange(ChangeEvent event) {
binding.setText( binding.getText().replace( " ",
"" ) );
}
} );
pop.addAttribute( constants.Binding(),
binding );
//Patterns can be negated, i.e. "not Pattern(...)"
final CheckBox chkNegated = new CheckBox();
pop.addAttribute( constants.negatePattern(),
chkNegated );
Button ok = new Button( constants.OK() );
ok.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent w) {
String ft = types.getItemText( types.getSelectedIndex() );
String fn = binding.getText();
if ( fn.equals( "" ) ) {
Window.alert( constants.PleaseEnterANameForFact() );
return;
} else if ( fn.equals( ft ) ) {
Window.alert( constants.PleaseEnterANameThatIsNotTheSameAsTheFactType() );