Search in sources :

Example 11 with DisplayType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.

the class ObjectReferenceColumnPanel method getIconDisplayType.

private DisplayType getIconDisplayType() {
    ObjectReferenceType ref = getModelObject();
    if (ref == null || ref.getType() == null) {
        return GuiDisplayTypeUtil.createDisplayType("");
    }
    ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(ref.getType());
    String icon = guiDescriptor != null ? guiDescriptor.getBlackIcon() : ObjectTypeGuiDescriptor.ERROR_ICON;
    // }
    return GuiDisplayTypeUtil.createDisplayType(icon);
}
Also used : ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType) ObjectTypeGuiDescriptor(com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor)

Example 12 with DisplayType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.

the class CreateTemplatePanel method createCompositedIcon.

// TODO copied from MainObjectListPanel
private CompositedIcon createCompositedIcon(CompiledObjectCollectionView collectionView) {
    DisplayType additionalButtonDisplayType = GuiDisplayTypeUtil.getNewObjectDisplayTypeFromCollectionView(collectionView, getPageBase());
    CompositedIconBuilder builder = new CompositedIconBuilder();
    builder.setBasicIcon(WebComponentUtil.getIconCssClass(additionalButtonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(additionalButtonDisplayType));
    return builder.build();
}
Also used : DisplayType(com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)

Example 13 with DisplayType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.

the class CreateTemplatePanel method getDefaultButtonDisplayType.

private DisplayType getDefaultButtonDisplayType() {
    String iconCssStyle = WebComponentUtil.createDefaultBlackIcon(getType());
    String sb = createStringResource("MainObjectListPanel.newObject").getString() + " " + createStringResource("ObjectTypeLowercase." + getType().getLocalPart()).getString();
    DisplayType display = GuiDisplayTypeUtil.createDisplayType(iconCssStyle, "", sb);
    display.setLabel(WebComponentUtil.createPolyFromOrigString(getType().getLocalPart(), "ObjectType." + getType().getLocalPart()));
    return display;
}
Also used : DisplayType(com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType)

Example 14 with DisplayType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.

the class GlobalPolicyRuleTabPanel method initBasicColumns.

private List<IColumn<PrismContainerValueWrapper<GlobalPolicyRuleType>, String>> initBasicColumns() {
    List<IColumn<PrismContainerValueWrapper<GlobalPolicyRuleType>, String>> columns = new ArrayList<>();
    columns.add(new CheckBoxHeaderColumn<>());
    PrismPropertyWrapperColumn<GlobalPolicyRuleType, String> linkColumn = new PrismPropertyWrapperColumn<GlobalPolicyRuleType, String>(getModel(), GlobalPolicyRuleType.F_NAME, ColumnType.LINK, getPageBase()) {

        @Override
        protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<GlobalPolicyRuleType>> rowModel) {
            getMultivalueContainerListPanel().itemDetailsPerformed(target, rowModel);
        }

        protected DisplayType getIconDisplayType(IModel<PrismContainerValueWrapper<GlobalPolicyRuleType>> rowModel) {
            return GuiDisplayTypeUtil.createDisplayType(WebComponentUtil.createDefaultBlackIcon(SystemConfigurationType.COMPLEX_TYPE));
        }
    };
    columns.add(linkColumn);
    columns.add(new PrismContainerWrapperColumn<>(getModel(), GlobalPolicyRuleType.F_POLICY_CONSTRAINTS, getPageBase()));
    columns.add(new PrismContainerWrapperColumn<>(getModel(), GlobalPolicyRuleType.F_POLICY_ACTIONS, getPageBase()));
    columns.add(new PrismPropertyWrapperColumn<GlobalPolicyRuleType, String>(getModel(), GlobalPolicyRuleType.F_POLICY_SITUATION, ColumnType.STRING, getPageBase()));
    List<InlineMenuItem> menuActionsList = getMultivalueContainerListPanel().getDefaultMenuActions();
    columns.add(new InlineMenuButtonColumn(menuActionsList, getPageBase()) {

        private static final long serialVersionUID = 1L;

        @Override
        public String getCssClass() {
            return " col-md-1 ";
        }
    });
    return columns;
}
Also used : IModel(org.apache.wicket.model.IModel) PrismPropertyWrapperColumn(com.evolveum.midpoint.gui.impl.component.data.column.PrismPropertyWrapperColumn) InlineMenuButtonColumn(com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn) ArrayList(java.util.ArrayList) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) GlobalPolicyRuleType(com.evolveum.midpoint.xml.ns._public.common.common_3.GlobalPolicyRuleType) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 15 with DisplayType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.

the class ColumnResultPanel method initLayout.

private void initLayout() {
    LoadableModel<CompositedIcon> compositedIcon = new LoadableModel<CompositedIcon>() {

        @Override
        protected CompositedIcon load() {
            OperationResult result = getModelObject();
            if (result == null) {
                return null;
            }
            String basicIconCssClass;
            String title;
            if (result.isEmpty()) {
                DisplayType displayType = getDisplayForEmptyResult();
                if (displayType == null || displayType.getIcon() == null || displayType.getIcon().getCssClass() == null) {
                    return null;
                }
                basicIconCssClass = displayType.getIcon().getCssClass();
                title = WebComponentUtil.getTranslatedPolyString(displayType.getTooltip());
            } else {
                OperationResultStatusPresentationProperties statusProperties = OperationResultStatusPresentationProperties.parseOperationalResultStatus(result.getStatus());
                basicIconCssClass = statusProperties.getIcon() + " fa-lg";
                title = getPageBase().createStringResource(statusProperties.getStatusLabelKey()).getString();
            }
            CompositedIconBuilder builder = new CompositedIconBuilder();
            String additionalCssClass = "";
            Throwable cause = RepoCommonUtils.getResultExceptionIfExists(getModelObject());
            if (OperationResultStatus.IN_PROGRESS.equals(result.getStatus()) && (cause instanceof CommunicationException) && isProjectionResult()) {
                IconType icon = new IconType();
                icon.setCssClass("fa fa-info-circle " + GuiStyleConstants.BLUE_COLOR);
                builder.appendLayerIcon(icon, LayeredIconCssStyle.BOTTOM_RIGHT_STYLE);
                builder.setTitle(getPageBase().createStringResource("ColumnResultPanel.message.communicationFail").getString());
                additionalCssClass = "change-password-icon-result-center";
            } else {
                builder.setTitle(title);
            }
            builder.setBasicIcon(basicIconCssClass, IconCssStyle.IN_ROW_STYLE, additionalCssClass);
            return builder.build();
        }
    };
    CompositedIconPanel iconPanel = new CompositedIconPanel(ID_RESULT_ICON, compositedIcon);
    iconPanel.setOutputMarkupId(true);
    add(iconPanel);
    AjaxButton showErrorDetailsButton = new AjaxButton(ID_DETAILS_BUTTON) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            getPageBase().showResult(ColumnResultPanel.this.getModelObject());
            target.add(getPageBase().getFeedbackPanel());
        }
    };
    showErrorDetailsButton.setOutputMarkupId(true);
    showErrorDetailsButton.add(AttributeAppender.append("title", getPageBase().createStringResource("ColumnResultPanel.showDetails")));
    showErrorDetailsButton.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return getModelObject() != null && RepoCommonUtils.getResultExceptionIfExists(getModelObject()) != null;
        }
    });
    add(showErrorDetailsButton);
}
Also used : DisplayType(com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType) CommunicationException(com.evolveum.midpoint.util.exception.CommunicationException) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) OperationResultStatusPresentationProperties(com.evolveum.midpoint.web.page.admin.server.dto.OperationResultStatusPresentationProperties) IconType(com.evolveum.midpoint.xml.ns._public.common.common_3.IconType) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) CompositedIconPanel(com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconPanel) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) CompositedIcon(com.evolveum.midpoint.gui.impl.component.icon.CompositedIcon) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Aggregations

DisplayType (com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType)18 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)6 Label (org.apache.wicket.markup.html.basic.Label)5 ReadOnlyModel (com.evolveum.midpoint.gui.api.model.ReadOnlyModel)4 CompositedIconBuilder (com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)4 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)4 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)4 PrismReferenceValue (com.evolveum.midpoint.prism.PrismReferenceValue)3 TooltipBehavior (com.evolveum.midpoint.web.util.TooltipBehavior)3 IModel (org.apache.wicket.model.IModel)3 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)2 CompositedIconPanel (com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconPanel)2 StringLimitationResult (com.evolveum.midpoint.model.api.validator.StringLimitationResult)2 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)2 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 CompositedIconButtonDto (com.evolveum.midpoint.web.component.CompositedIconButtonDto)2 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)2 ImagePanel (com.evolveum.midpoint.web.component.data.column.ImagePanel)2 EnableBehaviour (com.evolveum.midpoint.web.component.util.EnableBehaviour)2 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)2