use of cz.metacentrum.perun.webgui.tabs.memberstabs.MembershipExpirationTabItem in project perun by CESNET.
the class MembershipExpirationWidget method build.
/**
* Builds the widget
*/
private void build() {
statusWidget.clear(true);
statusWidget.setCellSpacing(0);
statusWidget.setCellPadding(0);
statusWidget.setStyleName("membership-expiration");
if (member != null) {
Attribute expire = member.getAttribute("urn:perun:member:attribute-def:def:membershipExpiration");
if (expire != null && !"null".equalsIgnoreCase(expire.getValue())) {
statusWidget.setHTML(0, 0, expire.getValue());
} else {
statusWidget.setHTML(0, 0, "<i>never</i>");
}
if (expire != null && expire.isWritable()) {
Anchor change = new Anchor("change");
change.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
PerunWebSession.getInstance().getTabManager().addTabToCurrentTab(new MembershipExpirationTabItem(member, new JsonCallbackEvents() {
@Override
public void onFinished(JavaScriptObject jso) {
if (containingTabItem != null) {
// forcefully refresh tab !!
containingTabItem.draw();
}
}
}));
}
});
statusWidget.setWidget(0, 1, change);
statusWidget.getFlexCellFormatter().setStyleName(0, 1, "change");
}
} else {
}
}
Aggregations