@Override
public void onUpdatePasswordClick() {
final EditorDriver<UserCredentials> editorDriver = view.getEditorDriver();
final UserCredentials userCredentials = editorDriver.flush();
final Set<ConstraintViolation<UserCredentials>> violations = getValidator().validate(userCredentials);
if(!violations.isEmpty()) {
editorDriver.setConstraintViolations((Set) violations);
return;
}
final boolean isUsingToken = userCredentials.getToken() != null && !"".equals(userCredentials.getToken().trim());
requests.userRequest().updatePassword(
userCredentials.getUsername(),
userCredentials.getToken(),
userCredentials.getCurrentPassword(),
userCredentials.getPassword())
.fire(new Receiver<UserProxy>() {
@Override
public void onSuccess(final UserProxy response) {
if (response == null) {