Esempio n. 1
0
  @PageShowing
  private void isLoggedIn() {
    identity.getUser(
        new RemoteCallback<User>() {

          @Override
          public void callback(final User response) {
            if (response != null) {
              form.getStyle().setDisplay(Style.Display.NONE);
              logout.getElement().getStyle().setDisplay(Style.Display.INLINE_BLOCK);
            } else {
              form.getStyle().setDisplay(Style.Display.BLOCK);
              logout.getElement().getStyle().setDisplay(Style.Display.NONE);
            }
          }
        });
  }
Esempio n. 2
0
  @EventHandler("login")
  private void loginClicked(ClickEvent event) {
    identity.login(
        new RemoteCallback<User>() {

          @Override
          public void callback(final User response) {
            if (response != null) {
              pageReturn.goBackOrHome();
            }
          }
        },
        new BusErrorCallback() {
          @Override
          public boolean error(Message message, Throwable throwable) {
            alert.getStyle().setDisplay(Style.Display.BLOCK);
            return false;
          }
        });
  }
Esempio n. 3
0
 @EventHandler("logout")
 private void logoutClicked(ClickEvent event) {
   identity.logout();
   welcomePage.go();
 }