validationMessage += (usernameTextBox == null || "".equals(usernameTextBox.getText())) ? "<BR>" : ""
+ BaseApplication.getMessages().getString("mustEnterPassword", "You must enter a password.");
valid = false;
}
if (!valid) {
final MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("validationFailed", "Validation Failed"),
validationMessage, true, true, true);
dialog.center();
}
return valid;
}
});
loginDialog.setCallback(new IDialogCallback() {
public void okPressed() {
login(usernameTextBox.getText(), passwordTextBox.getText());
}
public void cancelPressed() {
}
});
signupButton.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
loginDialog.hide();
// create an account, prepopulate UI with values from login dialog (user/pass)
showNewAccountDialog(true);
}
});
hintLink.setTitle("Retrieve your password hint.");
hintLink.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
hintLink.setStyleName("link");
hintLink.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
if (usernameTextBox.getText() == null || "".equals(usernameTextBox.getText())) {
final MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("error", "Error"), BaseApplication.getMessages()
.getString("enterUsername", "Enter your username."), true, true, true);
dialog.center();
} else {
getPasswordHint(usernameTextBox.getText());
}
}
});
readDisclaimer.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
String companyName = BaseApplication.getMessages().getString("companyName", "the Company");
String disclaimerText = "By using this website, you acknowledge that you have read and agree to these terms. Department staff may revise these terms periodically. If you continue to use this website after changes are made to these terms, it will mean that you accept such changes. If at any time you do not wish to accept the Terms, you may choose not to use this website.";
disclaimerText += "<BR><BR>The information contained in this website is for general information purposes only. The information is provided by {0} and whilst we endeavour to keep the information up-to-date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk.";
disclaimerText += "<BR><BR>In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this website.";
disclaimerText += "<BR><BR>Through this website you are able to link to other websites which are not under the control of {0}. We have no control over the nature, content and availability of those sites. The inclusion of any links does not necessarily imply a recommendation or endorse the views expressed within them.";
disclaimerText += "<BR><BR>Every effort is made to keep the website up and running smoothly. However, {0} takes no responsibility for, and will not be liable for, the website being temporarily unavailable due to technical issues beyond our control.";
disclaimerText = BaseApplication.getMessages().getString("disclaimerText", disclaimerText, companyName);
final MessageDialogBox dialog = new MessageDialogBox(BaseApplication.getMessages().getString("disclaimerAndTerms", "Disclaimer & Terms of Use"),
disclaimerText, true, true, true);
dialog.setWidth("600px");
dialog.center();
}
});
disclaimerCheckBox.setTitle(BaseApplication.getMessages().getString("disclaimerAgree", "You must read and agree in order to continue."));
// present account dialog
accountDialog.setText(BaseApplication.getMessages().getString("newAccount", "New Account"));