Exemplo n.º 1
0
  @Override
  protected void onBind() {
    super.onBind();
    registerHandler(
        getView()
            .getSendButton()
            .addClickHandler(
                new ClickHandler() {
                  @Override
                  public void onClick(ClickEvent event) {
                    sendCredentialsToServer();
                  }
                }));

    registerHandler(
        getView()
            .getFocusPanel()
            .addKeyDownHandler(
                new KeyDownHandler() {
                  @Override
                  public void onKeyDown(KeyDownEvent event) {
                    if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                      sendCredentialsToServer();
                    }
                  }
                }));
  }
Exemplo n.º 2
0
 @Override
 protected void onReveal() {
   super.onReveal();
   getView().clear();
 }