use of com.evolveum.midpoint.gui.api.util.FocusTabVisibleBehavior in project midpoint by Evolveum.
the class PageUser method createMainPanel.
@Override
protected AbstractObjectMainPanel<UserType> createMainPanel(String id) {
return new FocusMainPanel<UserType>(id, getObjectModel(), getAssignmentsModel(), getProjectionModel(), this) {
@Override
protected void addSpecificTabs(final PageAdminObjectDetails<UserType> parentPage, List<ITab> tabs) {
FocusTabVisibleBehavior authorization;
if (WebComponentUtil.isAuthorized(ModelAuthorizationAction.AUDIT_READ.getUrl())) {
authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_OBJECT_HISTORY_URL);
tabs.add(new PanelTab(parentPage.createStringResource("pageAdminFocus.objectHistory"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return createObjectHistoryTabPanel(panelId, parentPage);
}
});
}
authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_DELEGATIONS_URL);
tabs.add(new CountablePanelTab(parentPage.createStringResource("FocusType.delegations"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
userDelegationsTabPanel = new UserDelegationsTabPanel<>(panelId, getMainForm(), getObjectModel(), delegationsModel, privilegesListModel, PageUser.this);
return userDelegationsTabPanel;
}
@Override
public String getCount() {
return Integer.toString(delegationsModel.getObject() == null ? 0 : delegationsModel.getObject().size());
}
});
authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_DELEGATED_TO_ME_URL);
tabs.add(new CountablePanelTab(parentPage.createStringResource("FocusType.delegatedToMe"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new AssignmentTablePanel<UserType>(panelId, parentPage.createStringResource("FocusType.delegatedToMe"), getDelegatedToMeModel()) {
private static final long serialVersionUID = 1L;
@Override
public void populateAssignmentDetailsPanel(ListItem<AssignmentEditorDto> item) {
DelegationEditorPanel editor = new DelegationEditorPanel(ID_ROW, item.getModel(), true, privilegesListModel, PageUser.this);
item.add(editor);
}
@Override
public String getExcludeOid() {
return getObject().getOid();
}
@Override
protected List<InlineMenuItem> createAssignmentMenu() {
return new ArrayList<>();
}
};
}
@Override
public String getCount() {
return Integer.toString(getDelegatedToMeModel().getObject() == null ? 0 : getDelegatedToMeModel().getObject().size());
}
});
}
@Override
protected boolean getOptionsPanelVisibility() {
if (isSelfProfile()) {
return false;
} else {
return super.getOptionsPanelVisibility();
}
}
@Override
protected boolean areSavePreviewButtonsEnabled() {
return super.areSavePreviewButtonsEnabled() || (userDelegationsTabPanel != null ? userDelegationsTabPanel.isDelegationsModelChanged() : false);
}
};
}
use of com.evolveum.midpoint.gui.api.util.FocusTabVisibleBehavior in project midpoint by Evolveum.
the class PageUserHistory method createMainPanel.
@Override
protected AbstractObjectMainPanel<UserType> createMainPanel(String id) {
return new FocusMainPanel<UserType>(id, getObjectModel(), getAssignmentsModel(), getProjectionModel(), this) {
@Override
protected List<ITab> createTabs(final PageAdminObjectDetails<UserType> parentPage) {
List<ITab> tabs = new ArrayList<>();
FocusTabVisibleBehavior authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_BASIC_URL);
tabs.add(new PanelTab(parentPage.createStringResource("pageAdminFocus.basic"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return createFocusDetailsTabPanel(panelId, parentPage);
}
});
//hidden, will be displayed in future version
// authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_PROJECTIONS_URL);
// tabs.add(
// new CountablePanelTab(parentPage.createStringResource("pageAdminFocus.projections"), authorization) {
//
// private static final long serialVersionUID = 1L;
//
// @Override
// public WebMarkupContainer createPanel(String panelId) {
// return createFocusProjectionsTabPanel(panelId, parentPage);
// }
//
// @Override
// public String getCount() {
// return Integer.toString(getProjectionModel().getObject() == null ?
// 0 : getProjectionModel().getObject().size());
// }
// });
authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_ASSIGNMENTS_URL);
tabs.add(new CountablePanelTab(parentPage.createStringResource("pageAdminFocus.assignments"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return createFocusAssignmentsTabPanel(panelId, parentPage);
}
@Override
public String getCount() {
return Integer.toString(getAssignmentsModel().getObject() == null ? 0 : getAssignmentsModel().getObject().size());
}
});
authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_DELEGATED_TO_ME_URL);
tabs.add(new CountablePanelTab(parentPage.createStringResource("FocusType.delegatedToMe"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new AssignmentTablePanel<UserType>(panelId, parentPage.createStringResource("FocusType.delegatedToMe"), getDelegatedToMeModel()) {
private static final long serialVersionUID = 1L;
@Override
public void populateAssignmentDetailsPanel(ListItem<AssignmentEditorDto> item) {
DelegationEditorPanel editor = new DelegationEditorPanel(ID_ROW, item.getModel(), true, new ArrayList<AssignmentsPreviewDto>(), PageUserHistory.this);
item.add(editor);
}
@Override
public String getExcludeOid() {
return getObject().getOid();
}
@Override
protected List<InlineMenuItem> createAssignmentMenu() {
return new ArrayList<>();
}
};
}
@Override
public String getCount() {
return Integer.toString(getDelegatedToMeModel().getObject() == null ? 0 : getDelegatedToMeModel().getObject().size());
}
});
return tabs;
}
@Override
protected boolean getOptionsPanelVisibility() {
return false;
}
};
}
use of com.evolveum.midpoint.gui.api.util.FocusTabVisibleBehavior in project midpoint by Evolveum.
the class RoleMainPanel method createTabs.
@Override
protected List<ITab> createTabs(final PageAdminObjectDetails<RoleType> parentPage) {
List<ITab> tabs = super.createTabs(parentPage);
FocusTabVisibleBehavior authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_GOVERNANCE_URL);
tabs.add(new PanelTab(parentPage.createStringResource("pageRole.governance"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return createGovernancePanel(panelId);
}
@Override
public boolean isVisible() {
return super.isVisible() && getObjectWrapper().getStatus() != ContainerStatus.ADDING;
}
});
authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_POLICY_CONSTRAINTS_URL);
tabs.add(new PanelTab(parentPage.createStringResource("AbstractRoleType.policyConstraints"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new RolePolicyPanel(panelId, getObject());
}
});
authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_MEMBERS_URL);
return tabs;
}
Aggregations