Search in sources :

Example 1 with SingleContainerPanel

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

the class AssignmentsDetailsPanel method createConditionTab.

private PanelTab createConditionTab() {
    return new PanelTab(createStringResource("AssignmentType.condition")) {

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new SingleContainerPanel<>(panelId, PrismContainerWrapperModel.fromContainerValueWrapper(getModel(), AssignmentType.F_CONDITION), MappingType.COMPLEX_TYPE) {

                @Override
                protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
                    ItemPath assignmentConditionExpressionPath = ItemPath.create(AssignmentHolderType.F_ASSIGNMENT, AssignmentType.F_CONDITION, MappingType.F_EXPRESSION);
                    ItemPath inducementConditionExpressionPath = ItemPath.create(AbstractRoleType.F_INDUCEMENT, AssignmentType.F_CONDITION, MappingType.F_EXPRESSION);
                    ItemPath itemPath = itemWrapper.getPath();
                    if (itemPath.namedSegmentsOnly().equivalent(assignmentConditionExpressionPath) || itemPath.namedSegmentsOnly().equivalent(inducementConditionExpressionPath)) {
                        return ItemVisibility.AUTO;
                    } else {
                        return ItemVisibility.HIDDEN;
                    }
                }
            };
        }
    };
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) ItemPath(com.evolveum.midpoint.prism.path.ItemPath)

Example 2 with SingleContainerPanel

use of com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel 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 3 with SingleContainerPanel

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

the class LoggingContentPanel method initLayout.

@Override
protected void initLayout() {
    SingleContainerPanel panel = new SingleContainerPanel(ID_MAIN_PANEL, PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(SystemConfigurationType.F_LOGGING)), LoggingConfigurationType.COMPLEX_TYPE) {

        @Override
        protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
            ItemPath path = itemWrapper.getPath();
            if (path == null || path.isEmpty()) {
                return ItemVisibility.AUTO;
            }
            QName name;
            if (path.size() == 1) {
                name = path.firstToQName();
            } else {
                name = path.rest().firstToQName();
            }
            boolean hide = LoggingConfigurationType.F_CLASS_LOGGER.equals(name) || LoggingConfigurationType.F_SUB_SYSTEM_LOGGER.equals(name) || LoggingConfigurationType.F_APPENDER.equals(name);
            return hide ? ItemVisibility.HIDDEN : ItemVisibility.AUTO;
        }
    };
    add(panel);
}
Also used : ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) QName(javax.xml.namespace.QName) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) ItemPath(com.evolveum.midpoint.prism.path.ItemPath)

Example 4 with SingleContainerPanel

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

the class ObjectCollectionDefaultViewPanel method initLayout.

@Override
protected void initLayout() {
    SingleContainerPanel panel = new SingleContainerPanel<>(ID_PANEL, PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ObjectCollectionType.F_DEFAULT_VIEW), GuiObjectListViewType.COMPLEX_TYPE);
    add(panel);
}
Also used : SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)

Example 5 with SingleContainerPanel

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

the class MessageTemplateContentPanel method initLayout.

@Override
protected void initLayout() {
    SingleContainerPanel panel = new SingleContainerPanel(ID_MAIN_PANEL, PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(MessageTemplateType.F_DEFAULT_CONTENT)), MessageTemplateContentType.COMPLEX_TYPE);
    add(panel);
}
Also used : SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)

Aggregations

SingleContainerPanel (com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)25 ItemWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper)7 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)5 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)4 ItemVisibility (com.evolveum.midpoint.web.component.prism.ItemVisibility)3 ArrayList (java.util.ArrayList)3 QName (javax.xml.namespace.QName)3 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)3 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)3 RepeatingView (org.apache.wicket.markup.repeater.RepeatingView)2 DisplayNamePanel (com.evolveum.midpoint.gui.api.component.DisplayNamePanel)1 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 BasicMultivalueContainerListPanel (com.evolveum.midpoint.gui.impl.component.BasicMultivalueContainerListPanel)1 MultivalueContainerDetailsPanel (com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel)1 AbstractObjectMainPanel (com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel)1 TaskDetailsModel (com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel)1 ResourceAttributePanel (com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1