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));
}
Aggregations