Search in sources :

Example 1 with SwitchAssignmentTypePanel

use of com.evolveum.midpoint.web.component.assignment.SwitchAssignmentTypePanel in project midpoint by Evolveum.

the class AbstractRoleMainPanel method createTabs.

@Override
protected List<ITab> createTabs(final PageAdminObjectDetails<R> parentPage) {
    List<ITab> tabs = super.createTabs(parentPage);
    tabs.add(new PanelTab(parentPage.createStringResource("pageAdminFocus.applicablePolicies"), getTabVisibility(ComponentConstants.UI_FOCUS_TAB_APPLICABLE_POLICIES_URL, false, parentPage)) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new FocusApplicablePoliciesTabPanel<>(panelId, getObjectModel());
        }
    });
    tabs.add(new CountablePanelTab(parentPage.createStringResource("FocusType.inducement"), getTabVisibility(ComponentConstants.UI_FOCUS_TAB_INDUCEMENTS_URL, false, parentPage)) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            SwitchAssignmentTypePanel panel = new SwitchAssignmentTypePanel(panelId, PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), AbstractRoleType.F_INDUCEMENT), new ContainerPanelConfigurationType()) {

                private static final long serialVersionUID = 1L;

                @Override
                protected boolean isInducement() {
                    return true;
                }
            };
            return panel;
        }

        @Override
        public String getCount() {
            return getInducementsCount();
        }
    });
    tabs.add(new PanelTab(parentPage.createStringResource("pageRole.members"), getTabVisibility(ComponentConstants.UI_FOCUS_TAB_MEMBERS_URL, false, parentPage)) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return createMemberPanel(panelId, parentPage);
        }

        @Override
        public boolean isVisible() {
            return super.isVisible() && getObjectWrapper().getStatus() != ItemStatus.ADDED && isAllowedToReadRoleMembership(getObjectWrapper().getOid(), parentPage);
        }
    });
    tabs.add(new PanelTab(parentPage.createStringResource("pageRole.governance"), getTabVisibility(ComponentConstants.UI_FOCUS_TAB_GOVERNANCE_URL, false, parentPage)) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return createGovernancePanel(panelId, parentPage);
        }

        @Override
        public boolean isVisible() {
            return super.isVisible() && getObjectWrapper().getStatus() != ItemStatus.ADDED;
        }
    });
    return tabs;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) SwitchAssignmentTypePanel(com.evolveum.midpoint.web.component.assignment.SwitchAssignmentTypePanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 2 with SwitchAssignmentTypePanel

use of com.evolveum.midpoint.web.component.assignment.SwitchAssignmentTypePanel in project midpoint by Evolveum.

the class AssignmentHolderTypeAssignmentsTabPanel method initLayout.

private void initLayout() {
    WebMarkupContainer assignments = new WebMarkupContainer(ID_ASSIGNMENTS);
    assignments.setOutputMarkupId(true);
    add(assignments);
    PrismContainerWrapperModel<AHT, AssignmentType> model = PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), AssignmentHolderType.F_ASSIGNMENT);
    SwitchAssignmentTypePanel panel = createPanel(ID_ASSIGNMENTS_PANEL, model);
    assignments.add(panel);
}
Also used : AssignmentType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType) SwitchAssignmentTypePanel(com.evolveum.midpoint.web.component.assignment.SwitchAssignmentTypePanel) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

SwitchAssignmentTypePanel (com.evolveum.midpoint.web.component.assignment.SwitchAssignmentTypePanel)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 CountablePanelTab (com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab)1 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)1 AssignmentType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)1 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)1