contentPanel.setWidget(row, 1, disclaimerCheckBox);
contentPanel.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_LEFT);
row++;
accountDialog.setCallback(new IDialogCallback() {
public void okPressed() {
boolean validationFailed = false;
String validationMessage = "";
if (usernameTextBox.getText() == null || "".equals(usernameTextBox.getText())) {
validationMessage += BaseApplication.getMessages().getString("mustEnterUsername", "You must enter a username.") + "<BR>";
validationFailed = true;
}
if (passwordTextBox.getText() == null || "".equals(passwordTextBox.getText())) {
validationMessage += BaseApplication.getMessages().getString("mustEnterPassword", "You must enter a password and a confirmation password.") + "<BR>";
validationFailed = true;
}
if (!passwordTextBox.getText().equals(passwordConfirm.getText())) {
validationMessage += BaseApplication.getMessages().getString("passwordsDoNotMatch", "Passwords do not match.") + "<BR>";
validationFailed = true;
}
if (emailAddress.getText() == null || "".equals(emailAddress.getText()) || emailAddress.getText().indexOf("@") == -1) {
validationMessage += BaseApplication.getMessages().getString("mustEnterValidEmail", "You must enter a valid email address.") + "<BR>";
validationFailed = true;
}
if (dateBox.getValue() == null) {
validationMessage += BaseApplication.getMessages().getString("mustEnterBirthdate", "You must enter your birthdate.") + "<BR>";
validationFailed = true;
}
if (StringUtils.isEmpty(captchaValidationTextBox.getText())) {
validationMessage += BaseApplication.getMessages().getString("captchaValidationFailed", "You must enter validation text.") + "<BR>";
validationFailed = true;
}
if (!disclaimerCheckBox.getValue()) {
validationMessage += BaseApplication.getMessages().getString("mustReadDisclaimer",
"You must read and agree with the disclaimer statement to continue.")
+ "<BR>";
validationFailed = true;
}
if (validationFailed) {
final MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("validationFailed", "Validation Failed"),
validationMessage, true, true, true);
dialog.setCallback(new IDialogCallback() {
public void okPressed() {
accountDialog.center();
}
public void cancelPressed() {