pop.show();
}
protected void showNewPatternDialog() {
final FormStylePopup pop = new FormStylePopup();
pop.setTitle( GuidedDecisionTableConstants.INSTANCE.NewFactSelectTheType() );
final ListBox types = new ListBox();
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();
pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Binding(),
binding );
Button ok = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
ok.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent w ) {
//Validate column configuration
String ft = types.getItemText( types.getSelectedIndex() );
String fn = binding.getText();
if ( fn.equals( "" ) ) {
Window.alert( GuidedDecisionTableConstants.INSTANCE.PleaseEnterANameForFact() );
return;
} else if ( fn.equals( ft ) ) {
Window.alert( GuidedDecisionTableConstants.INSTANCE.PleaseEnterANameThatIsNotTheSameAsTheFactType() );
return;
} else if ( !isBindingUnique( fn ) ) {
Window.alert( GuidedDecisionTableConstants.INSTANCE.PleaseEnterANameThatIsNotAlreadyUsedByAnotherPattern() );
return;
}
//Configure column
editingCol.setBoundName( binding.getText() );
editingCol.setFactType( types.getItemText( types.getSelectedIndex() ) );
editingCol.setFactField( null );
makeLimitedValueWidget();
makeDefaultValueWidget();
doPatternLabel();
doFieldLabel();
doValueList();
pop.hide();
}
} );
pop.addAttribute( "",
ok );
pop.show();
}