Search in sources :

Example 1 with TooltipBehavior

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

the class WorkItemsPanel method createTypeIconColumn.

public IColumn<WorkItemDto, String> createTypeIconColumn(final boolean object) {
    // true = object, false = target
    return new IconColumn<WorkItemDto>(createStringResource("")) {

        @Override
        protected IModel<String> createIconModel(IModel<WorkItemDto> rowModel) {
            if (getObjectType(rowModel) == null) {
                return null;
            }
            ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(rowModel);
            String icon = guiDescriptor != null ? guiDescriptor.getBlackIcon() : ObjectTypeGuiDescriptor.ERROR_ICON;
            return new Model<>(icon);
        }

        private ObjectTypeGuiDescriptor getObjectTypeDescriptor(IModel<WorkItemDto> rowModel) {
            return ObjectTypeGuiDescriptor.getDescriptor(ObjectTypes.getObjectTypeFromTypeQName(getObjectType(rowModel)));
        }

        private QName getObjectType(IModel<WorkItemDto> rowModel) {
            return object ? rowModel.getObject().getObjectType() : rowModel.getObject().getTargetType();
        }

        @Override
        public void populateItem(Item<ICellPopulator<WorkItemDto>> item, String componentId, IModel<WorkItemDto> rowModel) {
            super.populateItem(item, componentId, rowModel);
            ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(rowModel);
            if (guiDescriptor != null) {
                item.add(AttributeModifier.replace("title", createStringResource(guiDescriptor.getLocalizationKey())));
                item.add(new TooltipBehavior());
            }
        }
    };
}
Also used : PageWorkItem(com.evolveum.midpoint.web.page.admin.workflow.PageWorkItem) Item(org.apache.wicket.markup.repeater.Item) TooltipBehavior(com.evolveum.midpoint.web.util.TooltipBehavior) IModel(org.apache.wicket.model.IModel) IconColumn(com.evolveum.midpoint.web.component.data.column.IconColumn) ObjectTypeGuiDescriptor(com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor) IModel(org.apache.wicket.model.IModel) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) Model(org.apache.wicket.model.Model) PropertyModel(org.apache.wicket.model.PropertyModel) WorkItemDto(com.evolveum.midpoint.web.page.admin.workflow.dto.WorkItemDto)

Example 2 with TooltipBehavior

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

the class CheckTableHeader method initLayout.

private void initLayout() {
    AjaxCheckBox check = new AjaxCheckBox(ID_CHECK, new PropertyModel<Boolean>(getModel(), ObjectWrapper.F_SELECTED)) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
        }
    };
    add(check);
    Label icon = new Label(ID_ICON);
    icon.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return "check-table-header-icon " + createAccountIcon();
        }
    }));
    add(icon);
    Label trigger = new Label(ID_TRIGGER);
    trigger.add(AttributeModifier.replace("title", new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return createTriggerTooltip();
        }
    }));
    trigger.add(new TooltipBehavior());
    trigger.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return hasTriggers();
        }
    });
    add(trigger);
    BootstrapLabel status = new BootstrapLabel(ID_STATUS, createStringResource("CheckTableHeader.label.error"), new Model<>(BootstrapLabel.State.DANGER));
    status.add(createFetchErrorVisibleBehaviour());
    add(status);
    AjaxLink showMore = new AjaxLink(ID_SHOW_MORE) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            onShowMorePerformed(target);
        }
    };
    showMore.add(createFetchErrorVisibleBehaviour());
    add(showMore);
    AjaxLink link = new AjaxLink(ID_LINK) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            onClickPerformed(target);
        }
    };
    add(link);
    Label name = new Label(ID_NAME, new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return getDisplayName();
        }
    });
    link.add(name);
    Label description = new Label(ID_DESCRIPTION, new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return getDescription();
        }
    });
    add(description);
    ToggleIconButton expandButton = new ToggleIconButton(ID_EXPAND, GuiStyleConstants.CLASS_ICON_EXPAND, GuiStyleConstants.CLASS_ICON_COLLAPSE) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            onClickPerformed(target);
        }

        @Override
        public boolean isOn() {
            return !CheckTableHeader.this.getModelObject().isMinimalized();
        }
    };
    add(expandButton);
}
Also used : ToggleIconButton(com.evolveum.midpoint.gui.api.component.togglebutton.ToggleIconButton) BootstrapLabel(com.evolveum.midpoint.web.component.BootstrapLabel) Label(org.apache.wicket.markup.html.basic.Label) BootstrapLabel(com.evolveum.midpoint.web.component.BootstrapLabel) AjaxCheckBox(org.apache.wicket.ajax.markup.html.form.AjaxCheckBox) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) TooltipBehavior(com.evolveum.midpoint.web.util.TooltipBehavior) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink)

Example 3 with TooltipBehavior

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

the class PageCertDecisions method initColumns.

// private void addVisibleOnWarningBehavior(Component c) {
// c.add(new VisibleEnableBehaviour() {
// @Override
// public boolean isVisible() {
// return PageCertDecisions.this.getFeedbackMessages().hasMessage(FeedbackMessage.WARNING);
// }
// });
// }
private List<IColumn<CertWorkItemDto, String>> initColumns() {
    List<IColumn<CertWorkItemDto, String>> columns = new ArrayList<>();
    IColumn<CertWorkItemDto, String> column;
    column = new CheckBoxHeaderColumn<>();
    columns.add(column);
    column = helper.createTypeColumn(OBJECT, this);
    columns.add(column);
    column = helper.createObjectNameColumn(this, "PageCertDecisions.table.objectName");
    columns.add(column);
    column = helper.createTypeColumn(TARGET, this);
    columns.add(column);
    column = helper.createTargetNameColumn(this, "PageCertDecisions.table.targetName");
    columns.add(column);
    if (isDisplayingAllItems()) {
        column = helper.createReviewerNameColumn(this, "PageCertDecisions.table.reviewer");
        columns.add(column);
    }
    column = helper.createDetailedInfoColumn(this);
    columns.add(column);
    column = helper.createConflictingNameColumn(this, "PageCertDecisions.table.conflictingTargetName");
    columns.add(column);
    if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_CERTIFICATION_ALL_URL, AuthorizationConstants.AUTZ_UI_CERTIFICATION_CAMPAIGN_URL)) {
        column = new AjaxLinkColumn<CertWorkItemDto>(createStringResource("PageCertDecisions.table.campaignName"), SearchingUtils.CAMPAIGN_NAME, CertWorkItemDto.F_CAMPAIGN_NAME) {

            private static final long serialVersionUID = 1L;

            @Override
            public void populateItem(Item<ICellPopulator<CertWorkItemDto>> item, String componentId, IModel<CertWorkItemDto> rowModel) {
                super.populateItem(item, componentId, rowModel);
                AccessCertificationCampaignType campaign = rowModel.getObject().getCampaign();
                if (campaign != null && campaign.getDescription() != null) {
                    item.add(AttributeModifier.replace("title", campaign.getDescription()));
                    item.add(new TooltipBehavior());
                }
            }

            @Override
            public void onClick(AjaxRequestTarget target, IModel<CertWorkItemDto> rowModel) {
                CertWorkItemDto dto = rowModel.getObject();
                PageParameters parameters = new PageParameters();
                parameters.add(OnePageParameterEncoder.PARAMETER, dto.getCampaignRef().getOid());
                navigateToNext(PageCertCampaign.class, parameters);
            }
        };
    } else {
        column = new AbstractColumn<CertWorkItemDto, String>(createStringResource("PageCertDecisions.table.campaignName"), SearchingUtils.CAMPAIGN_NAME) {

            private static final long serialVersionUID = 1L;

            @Override
            public void populateItem(Item<ICellPopulator<CertWorkItemDto>> item, String componentId, final IModel<CertWorkItemDto> rowModel) {
                item.add(new Label(componentId, new IModel<Object>() {

                    @Override
                    public Object getObject() {
                        return rowModel.getObject().getCampaignName();
                    }
                }));
            }
        };
    }
    columns.add(column);
    column = new PropertyColumn<CertWorkItemDto, String>(createStringResource("PageCertDecisions.table.iteration"), CertCaseOrWorkItemDto.F_ITERATION) {

        private static final long serialVersionUID = 1L;

        @Override
        public String getCssClass() {
            return "countLabel";
        }
    };
    columns.add(column);
    column = new AbstractColumn<CertWorkItemDto, String>(createStringResource("PageCertDecisions.table.campaignStage")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<CertWorkItemDto>> item, String componentId, final IModel<CertWorkItemDto> rowModel) {
            item.add(new Label(componentId, new IModel<String>() {

                @Override
                public String getObject() {
                    CertWorkItemDto dto = rowModel.getObject();
                    return dto.getCampaignStageNumber() + "/" + dto.getCampaignStageCount();
                }
            }));
            String stageName = rowModel.getObject().getCurrentStageName();
            if (stageName != null) {
                item.add(AttributeModifier.replace("title", stageName));
                item.add(new TooltipBehavior());
            }
        }

        @Override
        public String getCssClass() {
            return "countLabel";
        }
    };
    columns.add(column);
    column = new AbstractColumn<CertWorkItemDto, String>(createStringResource("PageCertDecisions.table.escalation")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<CertWorkItemDto>> item, String componentId, final IModel<CertWorkItemDto> rowModel) {
            item.add(new Label(componentId, new IModel<String>() {

                @Override
                public String getObject() {
                    CertWorkItemDto dto = rowModel.getObject();
                    Integer n = dto.getEscalationLevelNumber();
                    return n != null ? String.valueOf(n) : null;
                }
            }));
            String info = rowModel.getObject().getEscalationLevelInfo();
            if (info != null) {
                item.add(AttributeModifier.replace("title", info));
                item.add(new TooltipBehavior());
            }
        }

        @Override
        public String getCssClass() {
            return "countLabel";
        }
    };
    columns.add(column);
    column = new PropertyColumn<CertWorkItemDto, String>(createStringResource("PageCertDecisions.table.requested"), SearchingUtils.CURRENT_REVIEW_REQUESTED_TIMESTAMP, CertWorkItemDto.F_REVIEW_REQUESTED) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<CertWorkItemDto>> item, String componentId, IModel<CertWorkItemDto> rowModel) {
            super.populateItem(item, componentId, rowModel);
            CertWorkItemDto dto = rowModel.getObject();
            Date started = dto.getStageStarted();
            if (started != null) {
                item.add(AttributeModifier.replace("title", WebComponentUtil.getShortDateTimeFormattedValue(started, PageCertDecisions.this)));
                item.add(new TooltipBehavior());
            }
        }
    };
    columns.add(column);
    column = new PropertyColumn<CertWorkItemDto, String>(createStringResource("PageCertDecisions.table.deadline"), SearchingUtils.CURRENT_REVIEW_DEADLINE, CertWorkItemDto.F_DEADLINE_AS_STRING) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<CertWorkItemDto>> item, String componentId, final IModel<CertWorkItemDto> rowModel) {
            super.populateItem(item, componentId, rowModel);
            XMLGregorianCalendar deadline = rowModel.getObject().getCertCase().getCurrentStageDeadline();
            if (deadline != null) {
                item.add(AttributeModifier.replace("title", WebComponentUtil.formatDate(deadline)));
                item.add(new TooltipBehavior());
            }
        }
    };
    columns.add(column);
    final AvailableResponses availableResponses = new AvailableResponses(this);
    final int responses = availableResponses.getResponseKeys().size();
    column = new AbstractColumn<CertWorkItemDto, String>(new Model<>()) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<CertWorkItemDto>> cellItem, String componentId, IModel<CertWorkItemDto> rowModel) {
            cellItem.add(new MultiButtonPanel<CertWorkItemDto>(componentId, rowModel, responses + 1) {

                private static final long serialVersionUID = 1L;

                @Override
                protected Component createButton(int index, String componentId, IModel<CertWorkItemDto> model) {
                    AjaxIconButton btn;
                    if (index < responses) {
                        btn = buildDefaultButton(componentId, null, new Model(availableResponses.getTitle(index)), new Model<>("btn btn-sm " + getDecisionButtonColor(model, availableResponses.getResponseValues().get(index))), target -> recordActionPerformed(target, model.getObject(), availableResponses.getResponseValues().get(index)));
                        btn.add(new EnableBehaviour(() -> !decisionEquals(model, availableResponses.getResponseValues().get(index))));
                    } else {
                        btn = buildDefaultButton(componentId, null, new Model(availableResponses.getTitle(index)), new Model<>("btn btn-sm " + ButtonColorClass.DANGER), null);
                        btn.setEnabled(false);
                        btn.add(new VisibleBehaviour(() -> !availableResponses.isAvailable(model.getObject().getResponse())));
                    }
                    return btn;
                }
            });
        }
    };
    columns.add(column);
    column = new DirectlyEditablePropertyColumn<CertWorkItemDto>(createStringResource("PageCertDecisions.table.comment"), CertWorkItemDto.F_COMMENT) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onBlur(AjaxRequestTarget target, IModel model) {
            // TODO determine somehow if the model.comment was really changed
            recordActionPerformed(target, (CertWorkItemDto) model.getObject(), null);
        }
    };
    columns.add(column);
    columns.add(new InlineMenuHeaderColumn(createInlineMenu(availableResponses)));
    return columns;
}
Also used : VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) AjaxFormComponentUpdatingBehavior(org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) Date(java.util.Date) PageDescriptor(com.evolveum.midpoint.authentication.api.authorization.PageDescriptor) AuthorizationConstants(com.evolveum.midpoint.security.api.AuthorizationConstants) ButtonColorClass(com.evolveum.midpoint.web.component.data.column.DoubleButtonColumn.ButtonColorClass) com.evolveum.midpoint.web.page.admin.certification.dto(com.evolveum.midpoint.web.page.admin.certification.dto) AbstractColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IModel(org.apache.wicket.model.IModel) Label(org.apache.wicket.markup.html.basic.Label) AjaxIconButton(com.evolveum.midpoint.web.component.AjaxIconButton) Model(org.apache.wicket.model.Model) Component(org.apache.wicket.Component) MarkupContainer(org.apache.wicket.MarkupContainer) WebComponentUtil(com.evolveum.midpoint.gui.api.util.WebComponentUtil) Task(com.evolveum.midpoint.task.api.Task) AttributeModifier(org.apache.wicket.AttributeModifier) OnePageParameterEncoder(com.evolveum.midpoint.web.util.OnePageParameterEncoder) List(java.util.List) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) Item(org.apache.wicket.markup.repeater.Item) SystemException(com.evolveum.midpoint.util.exception.SystemException) SortOrder(org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder) AccessCertificationCampaignType(com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType) Form(org.apache.wicket.markup.html.form.Form) com.evolveum.midpoint.web.component.data.column(com.evolveum.midpoint.web.component.data.column) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) InlineMenuItemAction(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction) Trace(com.evolveum.midpoint.util.logging.Trace) UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) OBJECT(com.evolveum.midpoint.web.page.admin.certification.CertDecisionHelper.WhichObject.OBJECT) Table(com.evolveum.midpoint.web.component.data.Table) AvailableResponses(com.evolveum.midpoint.web.page.admin.certification.helpers.AvailableResponses) CheckBox(org.apache.wicket.markup.html.form.CheckBox) ArrayList(java.util.ArrayList) SecurityViolationException(com.evolveum.midpoint.util.exception.SecurityViolationException) Fragment(org.apache.wicket.markup.html.panel.Fragment) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) TooltipBehavior(com.evolveum.midpoint.web.util.TooltipBehavior) EnableBehaviour(com.evolveum.midpoint.web.component.util.EnableBehaviour) Url(com.evolveum.midpoint.authentication.api.authorization.Url) CertDecisionsStorage(com.evolveum.midpoint.web.session.CertDecisionsStorage) DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) AccessCertificationResponseType(com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationResponseType) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) MultiButtonPanel(com.evolveum.midpoint.web.component.data.MultiButtonPanel) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) HeaderMenuAction(com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction) PropertyColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn) TARGET(com.evolveum.midpoint.web.page.admin.certification.CertDecisionHelper.WhichObject.TARGET) AuthorizationAction(com.evolveum.midpoint.authentication.api.authorization.AuthorizationAction) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) TraceManager(com.evolveum.midpoint.util.logging.TraceManager) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) ArrayList(java.util.ArrayList) Label(org.apache.wicket.markup.html.basic.Label) AvailableResponses(com.evolveum.midpoint.web.page.admin.certification.helpers.AvailableResponses) TooltipBehavior(com.evolveum.midpoint.web.util.TooltipBehavior) AccessCertificationCampaignType(com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType) EnableBehaviour(com.evolveum.midpoint.web.component.util.EnableBehaviour) IModel(org.apache.wicket.model.IModel) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) Date(java.util.Date) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) IModel(org.apache.wicket.model.IModel) Model(org.apache.wicket.model.Model) AjaxIconButton(com.evolveum.midpoint.web.component.AjaxIconButton) MultiButtonPanel(com.evolveum.midpoint.web.component.data.MultiButtonPanel)

Example 4 with TooltipBehavior

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

the class CertDecisionHelper method createTypeColumn.

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

        @Override
        protected DisplayType getIconDisplayType(IModel<CertCaseOrWorkItemDto> rowModel) {
            ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(which, rowModel);
            String icon = guiDescriptor != null ? guiDescriptor.getBlackIcon() : ObjectTypeGuiDescriptor.ERROR_ICON;
            return GuiDisplayTypeUtil.createDisplayType(icon);
        }

        private ObjectTypeGuiDescriptor getObjectTypeDescriptor(WhichObject which, IModel<CertCaseOrWorkItemDto> rowModel) {
            QName targetType = rowModel.getObject().getObjectType(which);
            return ObjectTypeGuiDescriptor.getDescriptor(ObjectTypes.getObjectTypeFromTypeQName(targetType));
        }

        @Override
        public void populateItem(Item<ICellPopulator<CertCaseOrWorkItemDto>> item, String componentId, IModel<CertCaseOrWorkItemDto> rowModel) {
            super.populateItem(item, componentId, rowModel);
            ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(which, rowModel);
            if (guiDescriptor != null) {
                item.add(AttributeModifier.replace("title", page.createStringResource(guiDescriptor.getLocalizationKey())));
                item.add(new TooltipBehavior());
            }
        }
    };
    return column;
}
Also used : DisplayType(com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType) QName(javax.xml.namespace.QName) 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) ObjectTypeGuiDescriptor(com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor)

Example 5 with TooltipBehavior

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

the class CertDecisionHelper method createDetailedInfoColumn.

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

        @Override
        protected DisplayType getIconDisplayType(final IModel<CertCaseOrWorkItemDto> rowModel) {
            return GuiDisplayTypeUtil.createDisplayType("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 : DisplayType(com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType) 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

TooltipBehavior (com.evolveum.midpoint.web.util.TooltipBehavior)10 Label (org.apache.wicket.markup.html.basic.Label)6 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)5 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)5 IModel (org.apache.wicket.model.IModel)5 ObjectTypeGuiDescriptor (com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor)4 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)4 DisplayType (com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType)3 QName (javax.xml.namespace.QName)3 Item (org.apache.wicket.markup.repeater.Item)3 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)2 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 IconColumn (com.evolveum.midpoint.web.component.data.column.IconColumn)2 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)2 CertCaseOrWorkItemDto (com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto)2 AjaxEventBehavior (org.apache.wicket.ajax.AjaxEventBehavior)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 Model (org.apache.wicket.model.Model)2 PropertyModel (org.apache.wicket.model.PropertyModel)2 AuthorizationAction (com.evolveum.midpoint.authentication.api.authorization.AuthorizationAction)1