Search in sources :

Example 1 with ObjectTabVisibleBehavior

use of com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior in project midpoint by Evolveum.

the class TaskMainPanel method createOperationTab.

private void createOperationTab(List<ITab> tabs, PageTask parentPage) {
    ObjectTabVisibleBehavior<TaskType> operationTabVisibility = new ObjectTabVisibleBehavior<>(Model.of(getObjectWrapper().getObject()), ComponentConstants.UI_TASK_TAB_OPERATION_URL, parentPage) {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return super.isVisible() && parentPage.getTaskTabVisibilty().isOperationVisible();
        }
    };
    tabs.add(new PanelTab(parentPage.createStringResource("pageTaskEdit.operation"), operationTabVisibility) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new TaskOperationTabPanel(panelId, PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), TaskType.F_MODEL_OPERATION_CONTEXT));
        }
    });
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) ObjectTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 2 with ObjectTabVisibleBehavior

use of com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior in project midpoint by Evolveum.

the class TaskMainPanel method createSubtasksTab.

// private void createCleanupPoliciesTab(List<ITab> tabs, PageTask parentPage) {
// ObjectTabVisibleBehavior<TaskType> cleanupPoliciesTabVisibility = new ObjectTabVisibleBehavior<TaskType>
// (Model.of(getObjectWrapper().getObject()), ComponentConstants.UI_TASK_TAB_CLEANUP_POLICIES_URL, parentPage) {
// 
// private static final long serialVersionUID = 1L;
// 
// @Override
// public boolean isVisible() {
// return super.isVisible() && parentPage.getTaskTabVisibilty().isCleanupPolicyVisible();
// }
// };
// tabs.add(new PanelTab(parentPage.createStringResource("pageTask.cleanupPolicies.title"), cleanupPoliciesTabVisibility) {
// private static final long serialVersionUID = 1L;
// 
// @Override
// public WebMarkupContainer createPanel(String panelId) {
// ItemVisibilityHandler visibilityHandler = wrapper -> ItemVisibility.AUTO;
// return createContainerPanel(panelId, TaskType.COMPLEX_TYPE,
// PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), ItemPath.create(TaskType.F_EXTENSION, SchemaConstants.MODEL_EXTENSION_CLEANUP_POLICIES)),
// visibilityHandler, getTaskEditabilityHandler());
// }
// });
// 
// }
private void createSubtasksTab(List<ITab> tabs, PageTask parentPage) {
    ObjectTabVisibleBehavior<TaskType> subtasksTabVisibility = new ObjectTabVisibleBehavior<>(Model.of(getObjectWrapper().getObject()), ComponentConstants.UI_TASK_TAB_SUBTASKS_URL, parentPage) {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return super.isVisible() && parentPage.getTaskTabVisibilty().isSubtasksAndThreadsVisible(getTask());
        }
    };
    tabs.add(new PanelTab(parentPage.createStringResource("pageTask.subtasks.title"), subtasksTabVisibility) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new TaskSubtasksAndThreadsTabPanel(panelId, getObjectModel(), rootTaskModel);
        }
    });
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) ObjectTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 3 with ObjectTabVisibleBehavior

use of com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior in project midpoint by Evolveum.

the class TaskMainPanel method createInternalPerformanceTab.

private void createInternalPerformanceTab(List<ITab> tabs, PageTask parentPage) {
    ObjectTabVisibleBehavior<TaskType> internalPerfTabsVisibility = new ObjectTabVisibleBehavior<>(Model.of(getObjectWrapper().getObject()), ComponentConstants.UI_TASK_TAB_INTERNAL_PERFORMANCE_URL, parentPage) {

        private static final long serialVersionUID = 1L;

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

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new TaskInternalPerformanceTabPanel(panelId, getObjectModel());
        }
    });
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) ObjectTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 4 with ObjectTabVisibleBehavior

use of com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior in project midpoint by Evolveum.

the class TaskMainPanel method createBasicPanel.

private void createBasicPanel(List<ITab> tabs, PageTask parentPage) {
    ObjectTabVisibleBehavior<TaskType> basicTabVisibility = new ObjectTabVisibleBehavior<>(Model.of(getObjectWrapper().getObject()), ComponentConstants.UI_TASK_TAB_BASIC_URL, parentPage) {

        private static final long serialVersionUID = 1L;

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

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new TaskBasicTabPanel(panelId, getObjectModel()) {

                @Override
                protected void updateHandlerPerformed(AjaxRequestTarget target) {
                    parentPage.refresh(target);
                }
            };
        }
    });
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 5 with ObjectTabVisibleBehavior

use of com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior in project midpoint by Evolveum.

the class TaskMainPanel method createResultTab.

private void createResultTab(List<ITab> tabs, PageTask parentPage) {
    ObjectTabVisibleBehavior<TaskType> resultTabVisibility = new ObjectTabVisibleBehavior<>(Model.of(getObjectWrapper().getObject()), ComponentConstants.UI_TASK_TAB_RESULT_URL, parentPage) {

        private static final long serialVersionUID = 1L;

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

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new TaskResultTabPanel(panelId, getObjectModel());
        }
    });
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) ObjectTabVisibleBehavior(com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)9 ObjectTabVisibleBehavior (com.evolveum.midpoint.gui.api.util.ObjectTabVisibleBehavior)9 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)9 ItemEditabilityHandler (com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1