Search in sources :

Example 1 with PanelTab

use of com.evolveum.midpoint.gui.api.component.tabs.PanelTab 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);
        }
    };
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) DelegationEditorPanel(com.evolveum.midpoint.web.component.assignment.DelegationEditorPanel) UserDelegationsTabPanel(com.evolveum.midpoint.web.component.objectdetails.UserDelegationsTabPanel) AssignmentEditorDto(com.evolveum.midpoint.web.component.assignment.AssignmentEditorDto) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) PageAdminObjectDetails(com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) FocusMainPanel(com.evolveum.midpoint.web.component.objectdetails.FocusMainPanel) FocusTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.FocusTabVisibleBehavior)

Example 2 with PanelTab

use of com.evolveum.midpoint.gui.api.component.tabs.PanelTab 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;
        }
    };
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) DelegationEditorPanel(com.evolveum.midpoint.web.component.assignment.DelegationEditorPanel) AssignmentEditorDto(com.evolveum.midpoint.web.component.assignment.AssignmentEditorDto) ArrayList(java.util.ArrayList) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) PageAdminObjectDetails(com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) FocusMainPanel(com.evolveum.midpoint.web.component.objectdetails.FocusMainPanel) FocusTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.FocusTabVisibleBehavior) ArrayList(java.util.ArrayList) List(java.util.List) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)

Example 3 with PanelTab

use of com.evolveum.midpoint.gui.api.component.tabs.PanelTab 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);
    FocusTabVisibleBehavior authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_INDUCEMENTS_URL);
    tabs.add(new CountablePanelTab(parentPage.createStringResource("FocusType.inducement"), authorization) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new AssignmentTablePanel<R>(panelId, parentPage.createStringResource("FocusType.inducement"), inducementsModel) {

                private static final long serialVersionUID = 1L;

                @Override
                public List<AssignmentType> getAssignmentTypeList() {
                    return getObject().asObjectable().getInducement();
                }

                @Override
                public String getExcludeOid() {
                    return getObject().getOid();
                }

                @Override
                protected boolean ignoreMandatoryAttributes() {
                    return true;
                }
            };
        }

        @Override
        public String getCount() {
            return Integer.toString(inducementsModel.getObject() == null ? 0 : inducementsModel.getObject().size());
        }
    });
    authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_MEMBERS_URL);
    tabs.add(new PanelTab(parentPage.createStringResource("pageRole.members"), authorization) {

        private static final long serialVersionUID = 1L;

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

        @Override
        public boolean isVisible() {
            return super.isVisible() && getObjectWrapper().getStatus() != ContainerStatus.ADDING && isAllowedToReadRoleMembership(getObjectWrapper().getOid(), parentPage);
        }
    });
    return tabs;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) FocusTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.FocusTabVisibleBehavior) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) PageAssignmentsList(com.evolveum.midpoint.web.page.self.PageAssignmentsList) List(java.util.List) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 4 with PanelTab

use of com.evolveum.midpoint.gui.api.component.tabs.PanelTab in project midpoint by Evolveum.

the class PageResource method createTabsPanel.

private AjaxTabbedPanel<ITab> createTabsPanel() {
    List<ITab> tabs = new ArrayList<ITab>();
    tabs.add(new PanelTab(createStringResource("PageResource.tab.details")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ResourceDetailsTabPanel(panelId, resourceModel, PageResource.this);
        }
    });
    tabs.add(new PanelTab(createStringResource("PageResource.tab.content.tasks")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ResourceTasksPanel(panelId, true, resourceModel, PageResource.this);
        }
    });
    tabs.add(new PanelTab(createStringResource("PageResource.tab.content.account")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ResourceContentTabPanel(panelId, ShadowKindType.ACCOUNT, resourceModel, PageResource.this);
        }
    });
    tabs.add(new PanelTab(createStringResource("PageResource.tab.content.entitlement")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ResourceContentTabPanel(panelId, ShadowKindType.ENTITLEMENT, resourceModel, PageResource.this);
        }
    });
    tabs.add(new PanelTab(createStringResource("PageResource.tab.content.generic")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ResourceContentTabPanel(panelId, ShadowKindType.GENERIC, resourceModel, PageResource.this);
        }
    });
    tabs.add(new PanelTab(createStringResource("PageResource.tab.content.others")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ResourceContentTabPanel(panelId, null, resourceModel, PageResource.this);
        }
    });
    tabs.add(new PanelTab(createStringResource("PageResource.tab.connector")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ResourceConnectorPanel(panelId, null, resourceModel, PageResource.this);
        }
    });
    AjaxTabbedPanel<ITab> resourceTabs = new AjaxTabbedPanel<ITab>(ID_TAB_PANEL, tabs) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onTabChange(int index) {
            updateBreadcrumbParameters(PARAMETER_SELECTED_TAB, index);
        }
    };
    resourceTabs.setOutputMarkupId(true);
    return resourceTabs;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) ArrayList(java.util.ArrayList) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxTabbedPanel(com.evolveum.midpoint.web.component.AjaxTabbedPanel)

Example 5 with PanelTab

use of com.evolveum.midpoint.gui.api.component.tabs.PanelTab in project midpoint by Evolveum.

the class FocusMainPanel method addDefaultTabs.

protected void addDefaultTabs(final PageAdminObjectDetails<F> parentPage, List<ITab> tabs) {
    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);
        }
    });
    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(projectionModel.getObject() == null ? 0 : projectionModel.getObject().size());
        }
    });
    authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_PERSONAS_URL);
    tabs.add(new PanelTab(parentPage.createStringResource("pageAdminFocus.personas"), authorization) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new FocusPersonasTabPanel<F>(panelId, getMainForm(), getObjectModel(), parentPage);
        }
    });
    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(assignmentsModel.count());
        }
    });
    authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_TASKS_URL);
    tabs.add(new CountablePanelTab(parentPage.createStringResource("pageAdminFocus.tasks"), authorization) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new FocusTasksTabPanel<F>(panelId, getMainForm(), getObjectModel(), taskDtoProvider, parentPage);
        }

        @Override
        public String getCount() {
            return Long.toString(taskDtoProvider == null ? 0L : taskDtoProvider.size());
        }
    });
    if (!(parentPage instanceof PageSelfProfile)) {
        authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_REQUEST_ROLE_URL);
        tabs.add(new PanelTab(parentPage.createStringResource("pageAdminFocus.request"), authorization) {

            private static final long serialVersionUID = 1L;

            @Override
            public WebMarkupContainer createPanel(String panelId) {
                return createRequestAssignmentTabPanel(panelId, parentPage);
            }
        });
    }
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) FocusTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.FocusTabVisibleBehavior) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) PageSelfProfile(com.evolveum.midpoint.web.page.self.PageSelfProfile) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)8 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)8 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)6 CountablePanelTab (com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab)5 FocusTabVisibleBehavior (com.evolveum.midpoint.gui.api.util.FocusTabVisibleBehavior)5 ArrayList (java.util.ArrayList)4 AssignmentEditorDto (com.evolveum.midpoint.web.component.assignment.AssignmentEditorDto)3 FocusMainPanel (com.evolveum.midpoint.web.component.objectdetails.FocusMainPanel)3 PageAdminObjectDetails (com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails)3 List (java.util.List)3 DelegationEditorPanel (com.evolveum.midpoint.web.component.assignment.DelegationEditorPanel)2 AjaxTabbedPanel (com.evolveum.midpoint.web.component.AjaxTabbedPanel)1 UserDelegationsTabPanel (com.evolveum.midpoint.web.component.objectdetails.UserDelegationsTabPanel)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 RolePolicyPanel (com.evolveum.midpoint.web.page.admin.roles.RolePolicyPanel)1 MergeObjectsPanel (com.evolveum.midpoint.web.page.admin.users.component.MergeObjectsPanel)1 PageAssignmentsList (com.evolveum.midpoint.web.page.self.PageAssignmentsList)1 PageSelfProfile (com.evolveum.midpoint.web.page.self.PageSelfProfile)1 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)1 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)1