@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); } } }); }
@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; } }); }
@EventHandler("logout") private void logoutClicked(ClickEvent event) { identity.logout(); welcomePage.go(); }