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