use of org.apache.syncope.client.console.commons.ITabComponent in project syncope by apache.
the class Realm method buildTabList.
private List<ITab> buildTabList(final PageReference pageRef) {
List<ITab> tabs = new ArrayList<>();
tabs.add(new ITabComponent(new Model<>("DETAILS"), StandardEntitlement.REALM_CREATE, StandardEntitlement.REALM_UPDATE, StandardEntitlement.REALM_DELETE) {
private static final long serialVersionUID = -5861786415855103549L;
@Override
public Panel getPanel(final String panelId) {
final ActionsPanel<RealmTO> actionPanel = new ActionsPanel<>("actions", null);
if (realmTO.getFullPath().startsWith(SyncopeConstants.ROOT_REALM)) {
actionPanel.add(new ActionLink<RealmTO>(realmTO) {
private static final long serialVersionUID = 2802988981431379827L;
@Override
public void onClick(final AjaxRequestTarget target, final RealmTO ignore) {
onClickCreate(target);
}
}, ActionLink.ActionType.CREATE, StandardEntitlement.REALM_CREATE).hideLabel();
actionPanel.add(new ActionLink<RealmTO>(realmTO) {
private static final long serialVersionUID = 2802988981431379828L;
@Override
public void onClick(final AjaxRequestTarget target, final RealmTO ignore) {
onClickEdit(target, realmTO);
}
}, ActionLink.ActionType.EDIT, StandardEntitlement.REALM_UPDATE).hideLabel();
actionPanel.add(new ActionLink<RealmTO>(realmTO) {
private static final long serialVersionUID = 2802988981431379827L;
@Override
public void onClick(final AjaxRequestTarget target, final RealmTO ignore) {
onClickTemplate(target);
}
}, ActionLink.ActionType.TEMPLATE, StandardEntitlement.REALM_UPDATE).hideLabel();
actionPanel.add(new ActionLink<RealmTO>(realmTO) {
private static final long serialVersionUID = 2802988981431379829L;
@Override
public void onClick(final AjaxRequestTarget target, final RealmTO ignore) {
onClickDelete(target, realmTO);
}
}, ActionLink.ActionType.DELETE, StandardEntitlement.REALM_DELETE, true).hideLabel();
}
RealmDetails panel = new RealmDetails(panelId, realmTO, actionPanel, false);
panel.setContentEnabled(false);
actionPanel.setEnabled(true);
return panel;
}
@Override
public boolean isVisible() {
return SyncopeConsoleApplication.get().getSecuritySettings().getAuthorizationStrategy().isActionAuthorized(this, RENDER);
}
});
final Triple<UserFormLayoutInfo, GroupFormLayoutInfo, Map<String, AnyObjectFormLayoutInfo>> formLayoutInfo = FormLayoutInfoUtils.fetch(anyTypes.stream().map(EntityTO::getKey).collect(Collectors.toList()));
for (final AnyTypeTO anyType : anyTypes) {
tabs.add(new ITabComponent(new Model<>(anyType.getKey()), String.format("%s_SEARCH", anyType.getKey())) {
private static final long serialVersionUID = 1169585538404171118L;
@Override
public WebMarkupContainer getPanel(final String panelId) {
return new AnyPanel(panelId, anyType, realmTO, formLayoutInfo, true, pageRef);
}
@Override
public boolean isVisible() {
return SyncopeConsoleApplication.get().getSecuritySettings().getAuthorizationStrategy().isActionAuthorized(this, RENDER);
}
});
}
return tabs;
}
Aggregations