} );
final FlexTable table = new FlexTable();
VerticalPanel vp = new VerticalPanel();
vp.add( new SmallLabel( constants.FactTypes() ) );
vp.add( factsCombo );
table.setWidget( 0,
0,
vp );
vp = new VerticalPanel();
vp.add( new SmallLabel( constants.Field() ) );
vp.add( fieldsCombo );
table.setWidget( 1,
0,
vp );
vp = new VerticalPanel();
vp.add( new SmallLabel( "Custom Form URL:" ) ); //TODO i18n
Button btnUpdateURL = new Button( constants.OK(),
new ClickHandler() {
public void onClick(ClickEvent event) {
int w;
int h;
try {
w = Integer.parseInt( customFormWidth.getText() );
h = Integer.parseInt( customFormHeight.getText() );
} catch ( NumberFormatException ex ) {
Window.alert( "Width and Height must be integer values!" ); //TODO: I18N
return;
}
if ( ((WorkingSetConfigData) workingSet.getContent()).customForms == null ) {
((WorkingSetConfigData) workingSet.getContent()).customForms = new ArrayList<CustomFormConfiguration>();
}
String factType = factsCombo.getItemText( factsCombo.getSelectedIndex() );
String fieldName = fieldsCombo.getItemText( fieldsCombo.getSelectedIndex() );
CustomFormConfiguration newCustomFormConfiguration = CustomFormsContainer.getEmptyCustomFormConfiguration();
newCustomFormConfiguration.setFactType( factType );
newCustomFormConfiguration.setFieldName( fieldName );
newCustomFormConfiguration.setCustomFormURL( customFormURL.getText() );
newCustomFormConfiguration.setCustomFormWidth( w );
newCustomFormConfiguration.setCustomFormHeight( h );
workingSetEditor.getCustomFormsContainer().putCustomForm( newCustomFormConfiguration );
((WorkingSetConfigData) workingSet.getContent()).customForms = workingSetEditor.getCustomFormsContainer().getCustomForms();
}
} );
vp.add( customFormURL );
vp.add( new SmallLabel( "Width:" ) );
vp.add( customFormWidth );
vp.add( new SmallLabel( "Height:" ) );
vp.add( customFormHeight );
table.setWidget( 2,
0,
vp );