public void onChange( ChangeEvent event ) {
if ( isPortValid( portTextBox.getValue() ) ) {
emailConfig.setSmtpPort( Integer.parseInt( portTextBox.getValue() ) );
setDirty( true );
} else {
new MessageDialogBox( Messages.getString( "error" ), Messages.getString( "portValidationLength" ), false
, false, true ).center();
}
}
} );
prepareTextBox( fromAddressTextBox, new ChangeHandler() {
@Override
public void onChange( ChangeEvent event ) {
emailConfig.setDefaultFrom( fromAddressTextBox.getValue() );
setDirty( true );
}
} );
prepareTextBox( fromNameTextBox, new ChangeHandler() {
@Override
public void onChange( ChangeEvent event ) {
emailConfig.setFromName( fromNameTextBox.getValue() );
setDirty( true );
}
} );
prepareTextBox( userNameTextBox, new ChangeHandler() {
@Override
public void onChange( ChangeEvent event ) {
emailConfig.setUserId( userNameTextBox.getValue() );
setDirty( true );
}
} );
useSSLCheckBox.addValueChangeHandler( new ValueChangeHandler<Boolean>() {
public void onValueChange( final ValueChangeEvent<Boolean> booleanValueChangeEvent ) {
emailConfig.setUseSsl( useSSLCheckBox.getValue() );
setDirty( true );
}
} );
useStartTLSCheckBox.addValueChangeHandler( new ValueChangeHandler<Boolean>() {
public void onValueChange( final ValueChangeEvent<Boolean> booleanValueChangeEvent ) {
emailConfig.setUseStartTls( useStartTLSCheckBox.getValue() );
setDirty( true );
}
} );
protocolsListBox.addChangeHandler( new ChangeHandler() {
public void onChange( final ChangeEvent changeEvent ) {
emailConfig.setSmtpProtocol( protocolsListBox.getItemText( protocolsListBox.getSelectedIndex() ) );
setDirty( true );
}
} );
saveButton.addClickHandler( new ClickHandler() {
public void onClick( final ClickEvent clickEvent ) {
if ( isPortValid( portTextBox.getValue() ) ) {
setEmailConfig();
} else {
new MessageDialogBox( Messages.getString( "error" ), Messages.getString( "portValidationLength" ), false
, false, true ).center();
}
}
} );