Search in sources :

Example 6 with VisibleBehaviour

use of com.evolveum.midpoint.web.component.util.VisibleBehaviour in project midpoint by Evolveum.

the class PageCertCampaign method initBasicInfoLayout.

private void initBasicInfoLayout(Form mainForm) {
    mainForm.add(new Label(ID_CAMPAIGN_NAME, new PropertyModel<>(campaignModel, CertCampaignDto.F_NAME)));
    mainForm.add(new Label(ID_CAMPAIGN_DESCRIPTION, new PropertyModel<>(campaignModel, CertCampaignDto.F_DESCRIPTION)));
    mainForm.add(new Label(ID_CAMPAIGN_OWNER, new PropertyModel<>(campaignModel, CertCampaignDto.F_OWNER_NAME)));
    mainForm.add(new Label(ID_CAMPAIGN_NUMBER_OF_STAGES, new PropertyModel<>(campaignModel, CertCampaignDto.F_NUMBER_OF_STAGES)));
    mainForm.add(new Label(ID_CAMPAIGN_CURRENT_STATE, new PropertyModel<>(campaignModel, CertCampaignDto.F_CURRENT_STATE)));
    mainForm.add(new Label(ID_CAMPAIGN_TIME, new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            CertCampaignDto dto = campaignModel.getObject();
            return formatDuration(dto.getCampaignStart(), dto.getCampaignEnd());
        }
    }));
    mainForm.add(new Label(ID_STAGE_TIME, new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            CertCampaignDto dto = campaignModel.getObject();
            return formatStageDuration(dto.getStageStart(), dto.getStageDeadline(), dto.getStageEnd());
        }
    }));
    WebMarkupContainer escalationLevelInfoContainer = new WebMarkupContainer(ID_ESCALATION_LEVEL_INFO_CONTAINER);
    mainForm.add(escalationLevelInfoContainer);
    escalationLevelInfoContainer.add(new Label(ID_ESCALATION_LEVEL_INFO, new PropertyModel<String>(campaignModel, CertCampaignDto.F_ESCALATION_LEVEL_INFO)));
    escalationLevelInfoContainer.add(new VisibleBehaviour(() -> campaignModel.getObject().getEscalationLevelInfo() != null));
}
Also used : AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) Label(org.apache.wicket.markup.html.basic.Label) PropertyModel(org.apache.wicket.model.PropertyModel) CertCampaignDto(com.evolveum.midpoint.web.page.admin.certification.dto.CertCampaignDto) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)6 Label (org.apache.wicket.markup.html.basic.Label)4 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)4 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)3 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)3 PropertyModel (org.apache.wicket.model.PropertyModel)3 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)2 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)2 ListItem (org.apache.wicket.markup.html.list.ListItem)2 ListView (org.apache.wicket.markup.html.list.ListView)2 IModel (org.apache.wicket.model.IModel)2 Model (org.apache.wicket.model.Model)2 ObjectDeltaOperationPanel (com.evolveum.midpoint.gui.api.component.delta.ObjectDeltaOperationPanel)1 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 WebComponentUtil (com.evolveum.midpoint.gui.api.util.WebComponentUtil)1 WebModelServiceUtils (com.evolveum.midpoint.gui.api.util.WebModelServiceUtils)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 AuthorizationConstants (com.evolveum.midpoint.security.api.AuthorizationConstants)1 MidPointPrincipal (com.evolveum.midpoint.security.api.MidPointPrincipal)1