FormPanel addressPanel = new FormPanel();
addressPanel.setFrame( true );
addressPanel.setAutoHeight( true );
this.to = new EmailAddressInputField( TextProvider.get().dialog_contactlist_label_to() );
MultiFieldPanel multiField = new MultiFieldPanel();
this.to.setWidth( "100%" );
this.to.setHideLabel( true );
this.toButton = new Button( this.to.getFieldLabel() );
this.toButton.setMinWidth( LABEL_WIDTH );
this.toButton.addListener( new ButtonListenerAdapter() {
@Override
public void onClick( Button button, EventObject e ) {
RowSelectionModel sm = contactListPanel.getGridPanel().getSelectionModel();
if ( sm.getCount() > 0 ) {
String address = sm.getSelected().getAsString( ContactListFields.INTERNET_ADDRESS.name() );
if ( address != null && address.length() > 0 ) {
to.addEmailAddress( address );
}
}
}
} );
multiField.addToRow( this.toButton, LABEL_WIDTH + 5 );
multiField.addToRow( this.to, new ColumnLayoutData( 1.0 ) );
addressPanel.add( multiField, new AnchorLayoutData( "100%" ) );
this.cc = new EmailAddressInputField( TextProvider.get().dialog_contactlist_label_cc() );
multiField = new MultiFieldPanel();
this.cc.setWidth( "100%" );
this.cc.setHideLabel( true );
this.ccButton = new Button( this.cc.getFieldLabel() );
this.ccButton.setMinWidth( LABEL_WIDTH );
this.ccButton.addListener( new ButtonListenerAdapter() {
@Override
public void onClick( Button button, EventObject e ) {
RowSelectionModel sm = contactListPanel.getGridPanel().getSelectionModel();
if ( sm.getCount() > 0 ) {
String address = sm.getSelected().getAsString( ContactListFields.INTERNET_ADDRESS.name() );
if ( address != null && address.length() > 0 ) {
cc.addEmailAddress( address );
}
}
}
} );
multiField.addToRow( this.ccButton, LABEL_WIDTH + 5 );
multiField.addToRow( this.cc, new ColumnLayoutData( 1.0 ) );
addressPanel.add( multiField, new AnchorLayoutData( "100%" ) );
this.bcc = new EmailAddressInputField( TextProvider.get().dialog_contactlist_label_bcc() );
multiField = new MultiFieldPanel();
this.bcc.setWidth( "100%" );
this.bcc.setHideLabel( true );
this.bccButton = new Button( this.bcc.getFieldLabel() );
this.bccButton.setMinWidth( LABEL_WIDTH );