use of cz.metacentrum.perun.webgui.widgets.LogoutWidget in project perun by CESNET.
the class ApplicationFormLeftMenu method addLogoutItem.
public void addLogoutItem() {
// if not anonymous identity
if (!PerunWebSession.getInstance().getRpcUrl().startsWith("/non/rpc")) {
int i = menuContents.getRowCount();
menuContents.setWidget(i, 0, new Image(SmallIcons.INSTANCE.doorOutIcon()));
Anchor a = new Anchor(ApplicationMessages.INSTANCE.logout());
a.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Logout call = new Logout(new JsonCallbackEvents() {
@Override
public void onFinished(JavaScriptObject jso) {
Utils.clearFederationCookies();
History.newItem("logout");
RootLayoutPanel.get().clear();
RootLayoutPanel.get().add(new LogoutWidget());
}
});
call.retrieveData();
}
});
menuContents.setWidget(i, 1, a);
}
}
Aggregations