Search in sources :

Example 1 with CertGuiHandler

use of com.evolveum.midpoint.web.page.admin.certification.handlers.CertGuiHandler in project midpoint by Evolveum.

the class CertDecisionHelper method createDetailedInfoColumn.

<T extends CertCaseOrWorkItemDto> IColumn<T, String> createDetailedInfoColumn(final PageBase page) {
    IColumn column;
    column = new IconColumn<CertCaseOrWorkItemDto>(page.createStringResource("")) {

        @Override
        protected IModel<String> createIconModel(final IModel<CertCaseOrWorkItemDto> rowModel) {
            return new AbstractReadOnlyModel<String>() {

                @Override
                public String getObject() {
                    return "fa fa-fw fa-info-circle text-info";
                }
            };
        }

        @Override
        public void populateItem(Item<ICellPopulator<CertCaseOrWorkItemDto>> item, String componentId, IModel<CertCaseOrWorkItemDto> rowModel) {
            super.populateItem(item, componentId, rowModel);
            CertCaseOrWorkItemDto aCase = rowModel.getObject();
            String handlerUri;
            if (aCase instanceof CertWorkItemDto) {
                handlerUri = aCase.getHandlerUri();
            } else {
                handlerUri = ((PageCertCampaign) page).getCampaignHandlerUri();
            }
            CertGuiHandler handler = CertGuiHandlerRegistry.instance().getHandler(handlerUri);
            if (handler != null) {
                String title = handler.getCaseInfoButtonTitle(rowModel, page);
                item.add(AttributeModifier.replace("title", title));
                item.add(new TooltipBehavior());
            }
        }
    };
    return column;
}
Also used : IModel(org.apache.wicket.model.IModel) CertGuiHandler(com.evolveum.midpoint.web.page.admin.certification.handlers.CertGuiHandler) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) CertCaseOrWorkItemDto(com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto) TooltipBehavior(com.evolveum.midpoint.web.util.TooltipBehavior) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) CertWorkItemDto(com.evolveum.midpoint.web.page.admin.certification.dto.CertWorkItemDto)

Aggregations

CertCaseOrWorkItemDto (com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto)1 CertWorkItemDto (com.evolveum.midpoint.web.page.admin.certification.dto.CertWorkItemDto)1 CertGuiHandler (com.evolveum.midpoint.web.page.admin.certification.handlers.CertGuiHandler)1 TooltipBehavior (com.evolveum.midpoint.web.util.TooltipBehavior)1 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)1 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 IModel (org.apache.wicket.model.IModel)1