Search in sources :

Example 1 with ResourceAttributePanel

use of com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel in project midpoint by Evolveum.

the class AssignmentConstructionPanel method initLayout.

private void initLayout() {
    SingleContainerPanel<ConstructionType> baseConstructionPanel = new SingleContainerPanel<>(ID_BASIC, getModel(), ConstructionType.COMPLEX_TYPE) {

        @Override
        protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
            ItemPath itemPath = itemWrapper.getPath();
            if (isAssociation(itemPath)) {
                return ItemVisibility.HIDDEN;
            }
            if (isAttributePath(itemPath)) {
                return ItemVisibility.HIDDEN;
            }
            if (ConstructionType.F_KIND.equivalent(itemPath.lastName())) {
                return ItemVisibility.HIDDEN;
            }
            if (ConstructionType.F_INTENT.equivalent(itemPath.lastName())) {
                return ItemVisibility.HIDDEN;
            }
            if (ConstructionType.F_RESOURCE_REF.equivalent(itemPath.lastName())) {
                return ItemVisibility.HIDDEN;
            }
            return ItemVisibility.AUTO;
        }
    };
    add(baseConstructionPanel);
    ResourceAttributePanel attrsPanel = new ResourceAttributePanel(ID_ATTRIBUTES, PrismContainerWrapperModel.fromContainerWrapper(getModel(), ConstructionType.F_ATTRIBUTE), null);
    add(attrsPanel);
}
Also used : ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) ResourceAttributePanel(com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) ItemPath(com.evolveum.midpoint.prism.path.ItemPath)

Example 2 with ResourceAttributePanel

use of com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel in project midpoint by Evolveum.

the class ResourceObjectTypeDetailsPanel method createTabs.

@Override
@NotNull
protected List<ITab> createTabs() {
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new PanelTab(createStringResource("Attributes")) {

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ResourceAttributePanel(panelId, PrismContainerWrapperModel.fromContainerValueWrapper(getModel(), ResourceObjectTypeDefinitionType.F_ATTRIBUTE), getConfig());
        }
    });
    return tabs;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) ArrayList(java.util.ArrayList) ResourceAttributePanel(com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with ResourceAttributePanel

use of com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel in project midpoint by Evolveum.

the class ResourceSchemaHandlingPanel method createMultivalueContainerDetailsPanel.

private MultivalueContainerDetailsPanel<ResourceObjectTypeDefinitionType> createMultivalueContainerDetailsPanel(String panelId, IModel<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>> model) {
    return new MultivalueContainerDetailsPanel<>(panelId, model, true) {

        @Override
        protected ItemVisibility getBasicTabVisibity(ItemWrapper<?, ?> itemWrapper) {
            if (itemWrapper instanceof PrismContainerWrapper) {
                return ItemVisibility.HIDDEN;
            }
            return ItemVisibility.AUTO;
        }

        @Override
        @NotNull
        protected List<ITab> createTabs() {
            List<ITab> tabs = new ArrayList<>();
            tabs.add(new PanelTab(createStringResource("ResourceSchemaHandlingPanel.tab.attributes")) {

                @Override
                public WebMarkupContainer createPanel(String panelId) {
                    return new ResourceAttributePanel(panelId, PrismContainerWrapperModel.fromContainerValueWrapper(getModel(), ResourceObjectTypeDefinitionType.F_ATTRIBUTE), getPanelConfiguration());
                }
            });
            return tabs;
        }

        @Override
        protected DisplayNamePanel<ResourceObjectTypeDefinitionType> createDisplayNamePanel(String displayNamePanelId) {
            return new DisplayNamePanel<>(displayNamePanelId, new ItemRealValueModel<>(getModel())) {

                @Override
                protected IModel<String> createHeaderModel() {
                    return new ReadOnlyModel<>(() -> loadHeaderModel(getModelObject()));
                }

                @Override
                protected IModel<List<String>> getDescriptionLabelsModel() {
                    return new ReadOnlyModel<>(() -> loadDescriptionModel(getModelObject()));
                }
            };
        }
    };
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) MultivalueContainerDetailsPanel(com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) 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) DisplayNamePanel(com.evolveum.midpoint.gui.api.component.DisplayNamePanel) ReadOnlyModel(com.evolveum.midpoint.gui.api.model.ReadOnlyModel) ResourceAttributePanel(com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel) ArrayList(java.util.ArrayList) List(java.util.List)

Example 4 with ResourceAttributePanel

use of com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel in project midpoint by Evolveum.

the class ResourceSchemaHandlingTabPanel method createMultivalueContainerDetailsPanel.

private MultivalueContainerDetailsPanel<ResourceObjectTypeDefinitionType> createMultivalueContainerDetailsPanel(String panelId, IModel<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>> model) {
    return new MultivalueContainerDetailsPanel<>(panelId, model, true) {

        @Override
        protected ItemVisibility getBasicTabVisibity(ItemWrapper<?, ?> itemWrapper) {
            if (itemWrapper instanceof PrismContainerWrapper) {
                return ItemVisibility.HIDDEN;
            }
            return ItemVisibility.AUTO;
        }

        @Override
        @NotNull
        protected List<ITab> createTabs() {
            List<ITab> tabs = new ArrayList<>();
            tabs.add(new PanelTab(createStringResource("Attributes")) {

                @Override
                public WebMarkupContainer createPanel(String panelId) {
                    return new ResourceAttributePanel(panelId, PrismContainerWrapperModel.fromContainerValueWrapper(getModel(), ResourceObjectTypeDefinitionType.F_ATTRIBUTE), null);
                }
            });
            return tabs;
        }

        @Override
        protected DisplayNamePanel<ResourceObjectTypeDefinitionType> createDisplayNamePanel(String displayNamePanelId) {
            return new DisplayNamePanel<>(displayNamePanelId, new ItemRealValueModel<>(getModel()));
        }
    };
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) MultivalueContainerDetailsPanel(com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) 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) ResourceObjectTypeDefinitionType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceObjectTypeDefinitionType) DisplayNamePanel(com.evolveum.midpoint.gui.api.component.DisplayNamePanel) ResourceAttributePanel(com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel)

Aggregations

ResourceAttributePanel (com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel)4 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)3 ItemWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper)3 ArrayList (java.util.ArrayList)3 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)3 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)3 DisplayNamePanel (com.evolveum.midpoint.gui.api.component.DisplayNamePanel)2 PrismContainerWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper)2 MultivalueContainerDetailsPanel (com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel)2 ReadOnlyModel (com.evolveum.midpoint.gui.api.model.ReadOnlyModel)1 SingleContainerPanel (com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)1 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)1 ResourceObjectTypeDefinitionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceObjectTypeDefinitionType)1 List (java.util.List)1 NotNull (org.jetbrains.annotations.NotNull)1