Search in sources :

Example 1 with ItemEditabilityHandler

use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler 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)

Example 2 with ItemEditabilityHandler

use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler in project midpoint by Evolveum.

the class TaskMainPanel method createScheduleTab.

private void createScheduleTab(List<ITab> tabs, PageTask parentPage) {
    ObjectTabVisibleBehavior<TaskType> scheduleTabVisibility = new ObjectTabVisibleBehavior<>(Model.of(getObjectWrapper().getObject()), ComponentConstants.UI_TASK_TAB_SCHEDULE_URL, parentPage) {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return super.isVisible() && parentPage.getTaskTabVisibilty().isSchedulingVisible();
        }
    };
    tabs.add(new PanelTab(parentPage.createStringResource("pageTask.schedule.title"), scheduleTabVisibility) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new SingleContainerPanel<ScheduleType>(panelId, PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), TaskType.F_SCHEDULE), ScheduleType.COMPLEX_TYPE) {

                @Override
                protected ItemEditabilityHandler getEditabilityHandler() {
                    return TaskMainPanel.this.getTaskEditabilityHandler();
                }
            };
        }
    });
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) ItemEditabilityHandler(com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler) ObjectTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

ItemEditabilityHandler (com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler)2 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)1 ItemWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper)1 PrismContainerWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper)1 ObjectTabVisibleBehavior (com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior)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 SingleContainerPanel (com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)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 PanelType (com.evolveum.midpoint.web.application.PanelType)1 ItemVisibility (com.evolveum.midpoint.web.component.prism.ItemVisibility)1 RefreshableTabPanel (com.evolveum.midpoint.web.page.admin.server.RefreshableTabPanel)1 ContainerPanelConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType)1 TaskType (com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType)1 VirtualContainersSpecificationType (com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1