use of cz.metacentrum.perun.webgui.tabs.userstabs.UserDetailTabItem in project perun by CESNET.
the class MemberDetailTabItem method draw.
public Widget draw() {
this.titleWidget.setText(Utils.getStrippedStringWithEllipsis(member.getUser().getFullNameWithTitles().trim()));
// main panel
VerticalPanel vp = new VerticalPanel();
vp.setSize("100%", "100%");
// The table
AbsolutePanel dp = new AbsolutePanel();
//dp.setStyleName("decoration");
final FlexTable menu = new FlexTable();
menu.setCellSpacing(5);
menu.setWidget(0, 0, new Image(LargeIcons.INSTANCE.userGreenIcon()));
Label memberName = new Label();
memberName.setText(Utils.getStrippedStringWithEllipsis(member.getUser().getFullNameWithTitles(), 40));
memberName.setStyleName("now-managing");
memberName.setTitle(member.getUser().getFullNameWithTitles());
menu.setWidget(0, 1, memberName);
int column = 2;
menu.setHTML(0, column, " ");
menu.getFlexCellFormatter().setWidth(0, column, "25px");
column++;
if (JsonUtils.isExtendedInfoVisible()) {
menu.setHTML(0, column, "<strong>Member ID:</strong><br/><span class=\"inputFormInlineComment\">" + member.getId() + "</span>");
column++;
menu.setHTML(0, column, " ");
menu.getFlexCellFormatter().setWidth(0, column, "25px");
column++;
menu.setHTML(0, column, "<strong>User ID:</strong><br/><span class=\"inputFormInlineComment\">" + member.getUser().getId() + "</span>");
column++;
menu.setHTML(0, column, " ");
menu.getFlexCellFormatter().setWidth(0, column, "25px");
column++;
}
Anchor a = new Anchor("See user detail >>");
a.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
session.getTabManager().addTab(new UserDetailTabItem(member.getUser()));
}
});
if (session.isPerunAdmin()) {
menu.setWidget(0, column, a);
}
dp.add(menu);
vp.add(dp);
vp.setCellHeight(dp, "30px");
tabPanel.clear();
tabPanel.add(new MemberOverviewTabItem(member, groupId), "Overview");
tabPanel.add(new MemberGroupsTabItem(member, groupId), "Groups");
tabPanel.add(new MemberResourcesTabItem(member, groupId), "Resources");
tabPanel.add(new MemberApplicationsTabItem(member, groupId), "Applications");
tabPanel.add(new MemberSettingsTabItem(member, groupId), "Settings");
if (member.getUser().isServiceUser()) {
tabPanel.add(new MemberServiceUsersTabItem(member, groupId), "Associated users");
} else {
tabPanel.add(new MemberServiceUsersTabItem(member, groupId), "Service identities");
}
if (member.getUser().isSponsoredUser()) {
tabPanel.add(new MemberSponsoredUsersTabItem(member, groupId), "Sponsors");
} else if (!member.getUser().isSponsoredUser() && !member.getUser().isServiceUser()) {
tabPanel.add(new MemberSponsoredUsersTabItem(member, groupId), "Sponsored users");
}
// Resize must be called after page fully displays
Scheduler.get().scheduleDeferred(new Command() {
@Override
public void execute() {
tabPanel.finishAdding();
}
});
vp.add(tabPanel);
this.contentWidget.setWidget(vp);
return getWidget();
}
use of cz.metacentrum.perun.webgui.tabs.userstabs.UserDetailTabItem in project perun by CESNET.
the class MemberServiceUsersTabItem method draw.
public Widget draw() {
if (member.getUser().isServiceUser()) {
this.titleWidget.setText(Utils.getStrippedStringWithEllipsis(member.getUser().getFullNameWithTitles().trim()) + ": associated users");
} else {
this.titleWidget.setText(Utils.getStrippedStringWithEllipsis(member.getUser().getFullNameWithTitles().trim()) + ": service identities");
}
VerticalPanel vp = new VerticalPanel();
vp.setSize("100%", "100%");
// MENU
TabMenu menu = new TabMenu();
vp.add(menu);
vp.setCellHeight(menu, "30px");
menu.addWidget(UiElements.getRefreshButton(this));
if (member.getUser().isServiceUser()) {
// request
final GetUsersBySpecificUser request = new GetUsersBySpecificUser(member.getUserId());
request.setCheckable(false);
// table
CellTable<User> table;
if (session.isPerunAdmin()) {
table = request.getTable(new FieldUpdater<User, String>() {
public void update(int i, User user, String s) {
session.getTabManager().addTab(new UserDetailTabItem(user));
}
});
} else {
table = request.getTable();
}
table.addStyleName("perun-table");
table.setWidth("100%");
ScrollPanel sp = new ScrollPanel(table);
sp.addStyleName("perun-tableScrollPanel");
vp.add(sp);
} else {
final GetSpecificUsersByUser request = new GetSpecificUsersByUser(member.getUserId());
request.setCheckable(false);
request.setHideSponsored(true);
// table
CellTable<User> table;
if (session.isPerunAdmin()) {
table = request.getTable(new FieldUpdater<User, String>() {
public void update(int i, User user, String s) {
session.getTabManager().addTab(new UserDetailTabItem(user));
}
});
} else {
table = request.getTable();
}
table.addStyleName("perun-table");
table.setWidth("100%");
ScrollPanel sp = new ScrollPanel(table);
sp.addStyleName("perun-tableScrollPanel");
vp.add(sp);
}
contentWidget.setWidget(vp);
return getWidget();
}
Aggregations