Search in sources :

Example 6 with ItemVisibility

use of com.evolveum.midpoint.web.component.prism.ItemVisibility in project midpoint by Evolveum.

the class PageObjectCollection method getTabs.

private List<ITab> getTabs() {
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new PanelTab(createStringResource("pageObjectCollection.basic.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ObjectBasicPanel<ObjectCollectionType>(panelId, getObjectModel()) {

                @Override
                protected QName getType() {
                    return ObjectCollectionType.COMPLEX_TYPE;
                }

                @Override
                protected ItemVisibility getBasicTabVisibility(ItemWrapper<?, ?> itemWrapper) {
                    if (itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ObjectCollectionType.F_SUBTYPE)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ObjectCollectionType.F_DIAGNOSTIC_INFORMATION)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ObjectCollectionType.F_LIFECYCLE_STATE))) {
                        return ItemVisibility.HIDDEN;
                    }
                    return ItemVisibility.AUTO;
                }
            };
        }
    });
    tabs.add(new PanelTab(createStringResource("pageObjectCollection.baseCollection.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new SingleContainerPanel<CollectionRefSpecificationType>(panelId, createModel(getObjectModel(), ObjectCollectionType.F_BASE_COLLECTION), CollectionRefSpecificationType.COMPLEX_TYPE) {

                @Override
                protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
                    if (ItemPath.create(ObjectCollectionType.F_BASE_COLLECTION, CollectionRefSpecificationType.F_BASE_COLLECTION_REF).isSuperPathOrEquivalent(itemWrapper.getPath())) {
                        return ItemVisibility.HIDDEN;
                    }
                    return ItemVisibility.AUTO;
                }
            };
        }
    });
    tabs.add(new PanelTab(createStringResource("pageObjectCollection.defaultView.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), ObjectCollectionType.F_DEFAULT_VIEW, GuiObjectListViewType.COMPLEX_TYPE);
        }
    });
    tabs.add(new PanelTab(createStringResource("pageObjectCollection.domain.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), ObjectCollectionType.F_DOMAIN, CollectionRefSpecificationType.COMPLEX_TYPE);
        }
    });
    tabs.add(new PanelTab(createStringResource("pageObjectCollection.option.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), ObjectCollectionType.F_GET_OPTIONS, SelectorQualifiedGetOptionsType.COMPLEX_TYPE);
        }
    });
    return tabs;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) ItemVisibility(com.evolveum.midpoint.web.component.prism.ItemVisibility)

Example 7 with ItemVisibility

use of com.evolveum.midpoint.web.component.prism.ItemVisibility in project midpoint by Evolveum.

the class TaskBasicPanel method initLayout.

protected void initLayout() {
    SingleContainerPanel mainPanel = new SingleContainerPanel(ID_MAIN_PANEL, getObjectWrapperModel(), getPanelConfiguration()) {

        @Override
        protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
            return getBasicTabVisibility(itemWrapper.getPath());
        }

        @Override
        protected ItemEditabilityHandler getEditabilityHandler() {
            return wrapper -> getBasicTabEditability(wrapper.getPath());
        }

        @Override
        protected IModel<PrismContainerWrapper> createVirtualContainerModel(VirtualContainersSpecificationType virtualContainer) {
            if (isDeprecatedVirtualContainer(virtualContainer)) {
                return null;
            }
            return super.createVirtualContainerModel(virtualContainer);
        }
    };
    add(mainPanel);
}
Also used : ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) AbstractObjectMainPanel(com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) PanelDisplay(com.evolveum.midpoint.web.application.PanelDisplay) Arrays(java.util.Arrays) ItemEditabilityHandler(com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler) PanelType(com.evolveum.midpoint.web.application.PanelType) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) Collection(java.util.Collection) VirtualContainersSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType) Component(org.apache.wicket.Component) WebComponentUtil(com.evolveum.midpoint.gui.api.util.WebComponentUtil) ItemVisibility(com.evolveum.midpoint.web.component.prism.ItemVisibility) ItemPath(com.evolveum.midpoint.prism.path.ItemPath) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) TaskDetailsModel(com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel) List(java.util.List) ContainerPanelConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType) RefreshableTabPanel(com.evolveum.midpoint.web.page.admin.server.RefreshableTabPanel) ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) IModel(org.apache.wicket.model.IModel) Collections(java.util.Collections) PanelInstance(com.evolveum.midpoint.web.application.PanelInstance) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) VirtualContainersSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType)

Aggregations

ItemVisibility (com.evolveum.midpoint.web.component.prism.ItemVisibility)7 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)5 ItemWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper)5 ArrayList (java.util.ArrayList)5 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)5 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)5 SingleContainerPanel (com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)3 QName (javax.xml.namespace.QName)3 DisplayNamePanel (com.evolveum.midpoint.gui.api.component.DisplayNamePanel)2 MultivalueContainerDetailsPanel (com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel)2 ItemEditabilityHandler (com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler)1 PrismContainerWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper)1 WebComponentUtil (com.evolveum.midpoint.gui.api.util.WebComponentUtil)1 AbstractObjectMainPanel (com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel)1 TaskDetailsModel (com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel)1 ListMappingPanel (com.evolveum.midpoint.gui.impl.prism.panel.ListMappingPanel)1 ObjectTemplateItemPanel (com.evolveum.midpoint.gui.impl.prism.panel.ObjectTemplateItemPanel)1 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)1 PanelDisplay (com.evolveum.midpoint.web.application.PanelDisplay)1 PanelInstance (com.evolveum.midpoint.web.application.PanelInstance)1