}
public AuthPresenter(final SimpleEventBus bus, final Display view) {
this.view = view;
view.setCurrentLocale(LocaleInfo.getCurrentLocale());
view.getUsernameField().addKeyDownHandler(new KeyDownHandler() {
@Override
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
bus.fireEvent(new AuthEvent(view.getUsername(), view.getPassword()));
}
}
});
view.getPasswordField().addKeyDownHandler(new KeyDownHandler() {
@Override
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
bus.fireEvent(new AuthEvent(view.getUsername(), view.getPassword()));
}