Search in sources :

Example 6 with PanelTab

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

the class FocusMainPanel method createTabs.

@Override
protected List<ITab> createTabs(final PageAdminObjectDetails<F> parentPage) {
    List<ITab> tabs = new ArrayList<>();
    List<ObjectFormType> objectFormTypes = parentPage.getObjectFormTypes();
    // default tabs are always added to component structure, visibility is decided later in
    // visible behavior based on adminGuiConfiguration
    addDefaultTabs(parentPage, tabs);
    addSpecificTabs(parentPage, tabs);
    if (objectFormTypes == null) {
        return tabs;
    }
    for (ObjectFormType objectFormType : objectFormTypes) {
        final FormSpecificationType formSpecificationType = objectFormType.getFormSpecification();
        if (formSpecificationType == null) {
            continue;
        }
        String title = formSpecificationType.getTitle();
        if (title == null) {
            title = "pageAdminFocus.extended";
        }
        if (StringUtils.isEmpty(formSpecificationType.getPanelClass())) {
            continue;
        }
        tabs.add(new PanelTab(parentPage.createStringResource(title)) {

            private static final long serialVersionUID = 1L;

            @Override
            public WebMarkupContainer createPanel(String panelId) {
                return createTabPanel(panelId, formSpecificationType, parentPage);
            }
        });
    }
    return tabs;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) ArrayList(java.util.ArrayList) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 7 with PanelTab

use of com.evolveum.midpoint.gui.api.component.tabs.PanelTab 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;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) FocusTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.FocusTabVisibleBehavior) RolePolicyPanel(com.evolveum.midpoint.web.page.admin.roles.RolePolicyPanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 8 with PanelTab

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

the class PageMergeObjects method createMainPanel.

@Override
protected AbstractObjectMainPanel<UserType> createMainPanel(String id) {
    return new FocusMainPanel<UserType>(id, getObjectModel(), new CountableLoadableModel<AssignmentEditorDto>() {

        @Override
        protected List<AssignmentEditorDto> load() {
            return new ArrayList<>();
        }
    }, new LoadableModel<List<FocusSubwrapperDto<ShadowType>>>() {

        @Override
        protected List<FocusSubwrapperDto<ShadowType>> load() {
            return new ArrayList<>();
        }
    }, this) {

        @Override
        protected List<ITab> createTabs(final PageAdminObjectDetails<UserType> parentPage) {
            List<ITab> tabs = new ArrayList<>();
            tabs.add(new PanelTab(parentPage.createStringResource("PageMergeObjects.tabTitle"), new VisibleEnableBehaviour()) {

                private static final long serialVersionUID = 1L;

                @Override
                public WebMarkupContainer createPanel(String panelId) {
                    mergeObjectsPanel = new MergeObjectsPanel(panelId, mergeObjectModel, mergeWithObjectModel, type, PageMergeObjects.this);
                    return mergeObjectsPanel;
                }
            });
            return tabs;
        }

        @Override
        protected boolean isPreviewButtonVisible() {
            return false;
        }

        @Override
        protected boolean getOptionsPanelVisibility() {
            return false;
        }
    };
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) MergeObjectsPanel(com.evolveum.midpoint.web.page.admin.users.component.MergeObjectsPanel) AssignmentEditorDto(com.evolveum.midpoint.web.component.assignment.AssignmentEditorDto) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) ArrayList(java.util.ArrayList) 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) ArrayList(java.util.ArrayList) List(java.util.List) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

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