use of com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseDto in project midpoint by Evolveum.
the class PageCertCampaign method initColumns.
private List<IColumn<CertCaseDto, String>> initColumns() {
List<IColumn<CertCaseDto, String>> columns = new ArrayList<>();
IColumn column;
column = helper.createTypeColumn(OBJECT, this);
columns.add(column);
column = helper.createObjectNameColumn(this, "PageCertCampaign.table.objectName");
columns.add(column);
column = helper.createTypeColumn(TARGET, this);
columns.add(column);
column = helper.createTargetNameColumn(this, "PageCertCampaign.table.targetName");
columns.add(column);
column = helper.createDetailedInfoColumn(this);
columns.add(column);
if (AccessCertificationApiConstants.EXCLUSION_HANDLER_URI.equals(campaignModel.getObject().getHandlerUri())) {
column = helper.createConflictingNameColumn(this, "PageCertCampaign.table.conflictingTargetName");
columns.add(column);
}
column = new PropertyColumn(createStringResource("PageCertCampaign.table.reviewers"), CertCaseDto.F_CURRENT_REVIEWERS);
columns.add(column);
column = new PropertyColumn(createStringResource("PageCertCampaign.table.reviewedAt"), CertCaseDto.F_REVIEWED_AT);
columns.add(column);
column = new PropertyColumn(createStringResource("PageCertCampaign.table.reviewedBy"), CertCaseDto.F_REVIEWED_BY);
columns.add(column);
column = new PropertyColumn(createStringResource("PageCertCampaign.table.reviewedInStage"), CertCaseDto.F_CURRENT_RESPONSE_STAGE_NUMBER);
columns.add(column);
final AvailableResponses availableResponses = new AvailableResponses(this);
final int responses = availableResponses.getCount();
column = new AbstractColumn<CertCaseDto, String>(new Model<>()) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<CertCaseDto>> cellItem, String componentId, IModel<CertCaseDto> rowModel) {
cellItem.add(new MultiButtonPanel<CertCaseDto>(componentId, rowModel, responses + 1) {
private static final long serialVersionUID = 1L;
@Override
protected Component createButton(int index, String componentId, IModel<CertCaseDto> model) {
AjaxIconButton btn = null;
if (index < responses) {
btn = buildDefaultButton(componentId, null, new Model(availableResponses.getTitle(index)), new Model<>("btn btn-sm " + getDecisionButtonColor(model, availableResponses.getResponseValues().get(index))), null);
} else {
btn = buildDefaultButton(componentId, null, new Model(availableResponses.getTitle(index)), new Model<>("btn btn-sm " + ButtonColorClass.DANGER), null);
btn.add(new VisibleBehaviour(() -> !availableResponses.isAvailable(model.getObject().getOverallOutcome())));
}
btn.setEnabled(false);
return btn;
}
});
}
};
columns.add(column);
column = new PropertyColumn(createStringResource("PageCertCampaign.table.comments"), CertCaseDto.F_COMMENTS);
columns.add(column);
column = new PropertyColumn(createStringResource("PageCertCampaign.table.remediedAt"), CertCaseDto.F_REMEDIED_AT);
columns.add(column);
return columns;
}
Aggregations