Search in sources :

Example 1 with EvaluatedTriggerGroupPanel

use of com.evolveum.midpoint.web.page.admin.workflow.EvaluatedTriggerGroupPanel in project midpoint by Evolveum.

the class ApprovalProcessesPreviewPanel method initLayout.

private void initLayout() {
    ListView<ApprovalProcessExecutionInformationDto> list = new ListView<ApprovalProcessExecutionInformationDto>(ID_PROCESSES, getModel()) {

        @Override
        protected void populateItem(ListItem<ApprovalProcessExecutionInformationDto> item) {
            item.add(new Label(ID_NAME, LoadableModel.create(() -> {
                String targetName = item.getModelObject().getTargetName();
                if (targetName != null) {
                    return ApprovalProcessesPreviewPanel.this.getString("ApprovalProcessesPreviewPanel.processRelatedTo", targetName);
                } else {
                    return getString("ApprovalProcessesPreviewPanel.process");
                }
            }, false)));
            item.add(new ApprovalProcessExecutionInformationPanel(ID_PREVIEW, item.getModel()));
            item.add(new EvaluatedTriggerGroupPanel(ID_TRIGGERS, new PropertyModel<>(item.getModel(), ApprovalProcessExecutionInformationDto.F_TRIGGERS)));
        }
    };
    add(list);
}
Also used : ApprovalProcessExecutionInformationDto(com.evolveum.midpoint.web.page.admin.workflow.dto.ApprovalProcessExecutionInformationDto) ListView(org.apache.wicket.markup.html.list.ListView) EvaluatedTriggerGroupPanel(com.evolveum.midpoint.web.page.admin.workflow.EvaluatedTriggerGroupPanel) Label(org.apache.wicket.markup.html.basic.Label) PropertyModel(org.apache.wicket.model.PropertyModel) ListItem(org.apache.wicket.markup.html.list.ListItem)

Example 2 with EvaluatedTriggerGroupPanel

use of com.evolveum.midpoint.web.page.admin.workflow.EvaluatedTriggerGroupPanel in project midpoint by Evolveum.

the class SwitchableApprovalProcessPreviewsPanel method initLayout.

private void initLayout(IModel<Boolean> showNextStagesModel) {
    setOutputMarkupId(true);
    WebMarkupContainer nextStagesContainer = new WebMarkupContainer(ID_NEXT_STAGES_CONTAINER);
    nextStagesContainer.add(new ApprovalProcessExecutionInformationPanel(ID_NEXT_STAGES, nextStagesModel));
    nextStagesContainer.add(WebComponentUtil.createHelp(ID_NEXT_STAGES_HELP));
    nextStagesContainer.add(new VisibleBehaviour(() -> nextStagesModel.getObject() != null && CollectionUtils.isNotEmpty(nextStagesModel.getObject().getStages()) && displayedProcessInfoBox == ProcessInfoBox.NEXT_STAGES));
    add(nextStagesContainer);
    WebMarkupContainer wholeProcessContainer = new WebMarkupContainer(ID_WHOLE_PROCESS_CONTAINER);
    wholeProcessContainer.add(new ApprovalProcessExecutionInformationPanel(ID_WHOLE_PROCESS, wholeProcessModel));
    wholeProcessContainer.add(new EvaluatedTriggerGroupPanel(ID_TRIGGERS, new PropertyModel<>(wholeProcessModel, ApprovalProcessExecutionInformationDto.F_TRIGGERS)));
    wholeProcessContainer.add(WebComponentUtil.createHelp(ID_WHOLE_PROCESS_HELP));
    wholeProcessContainer.add(new VisibleBehaviour(() -> displayedProcessInfoBox == ProcessInfoBox.WHOLE_PROCESS));
    add(wholeProcessContainer);
    WebMarkupContainer showNextStagesContainer = new WebMarkupContainer(ID_SHOW_NEXT_STAGES_CONTAINER);
    showNextStagesContainer.add(new AjaxFallbackLink<Void>(ID_SHOW_NEXT_STAGES) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(Optional<AjaxRequestTarget> target) {
            displayedProcessInfoBox = ProcessInfoBox.NEXT_STAGES;
            target.get().add(SwitchableApprovalProcessPreviewsPanel.this);
        }
    });
    showNextStagesContainer.add(WebComponentUtil.createHelp(ID_SHOW_NEXT_STAGES_HELP));
    showNextStagesContainer.add(new VisibleBehaviour(() -> Boolean.TRUE.equals(showNextStagesModel.getObject()) && displayedProcessInfoBox != ProcessInfoBox.NEXT_STAGES));
    add(showNextStagesContainer);
    WebMarkupContainer showWholeProcessContainer = new WebMarkupContainer(ID_SHOW_WHOLE_PROCESS_CONTAINER);
    showWholeProcessContainer.add(new AjaxFallbackLink<Void>(ID_SHOW_WHOLE_PROCESS) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(Optional<AjaxRequestTarget> target) {
            displayedProcessInfoBox = ProcessInfoBox.WHOLE_PROCESS;
            target.get().add(SwitchableApprovalProcessPreviewsPanel.this);
        }
    });
    showWholeProcessContainer.add(new VisibleBehaviour(() -> displayedProcessInfoBox != ProcessInfoBox.WHOLE_PROCESS));
    showWholeProcessContainer.add(WebComponentUtil.createHelp(ID_SHOW_WHOLE_PROCESS_HELP));
    add(showWholeProcessContainer);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) EvaluatedTriggerGroupPanel(com.evolveum.midpoint.web.page.admin.workflow.EvaluatedTriggerGroupPanel) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) PropertyModel(org.apache.wicket.model.PropertyModel) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

EvaluatedTriggerGroupPanel (com.evolveum.midpoint.web.page.admin.workflow.EvaluatedTriggerGroupPanel)2 PropertyModel (org.apache.wicket.model.PropertyModel)2 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)1 ApprovalProcessExecutionInformationDto (com.evolveum.midpoint.web.page.admin.workflow.dto.ApprovalProcessExecutionInformationDto)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 Label (org.apache.wicket.markup.html.basic.Label)1 ListItem (org.apache.wicket.markup.html.list.ListItem)1 ListView (org.apache.wicket.markup.html.list.ListView)1