Search in sources :

Example 1 with CompositedIconButtonDto

use of com.evolveum.midpoint.web.component.CompositedIconButtonDto in project midpoint by Evolveum.

the class PageSystemConfiguration method createCompositedButton.

private CompositedIconButtonDto createCompositedButton(String icon, Class<? extends WebPage> page) {
    String title = page.getSimpleName() + ".title";
    CompositedIconButtonDto button = new CompositedIconButtonDto();
    CompositedIconBuilder builder = new CompositedIconBuilder();
    builder.setTitle(title);
    builder.setBasicIcon(icon, IconCssStyle.IN_ROW_STYLE);
    button.setCompositedIcon(builder.build());
    DisplayType displayType = new DisplayType();
    displayType.setLabel(new PolyStringType(title));
    button.setAdditionalButtonDisplayType(displayType);
    button.setPage(page);
    return button;
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) DisplayType(com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType) CompositedIconButtonDto(com.evolveum.midpoint.web.component.CompositedIconButtonDto) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)

Example 2 with CompositedIconButtonDto

use of com.evolveum.midpoint.web.component.CompositedIconButtonDto in project midpoint by Evolveum.

the class PageCreateFromTemplate method loadButtonDescriptions.

protected LoadableModel<MultiFunctinalButtonDto> loadButtonDescriptions() {
    return new LoadableModel<>(false) {

        @Override
        protected MultiFunctinalButtonDto load() {
            List<CompositedIconButtonDto> additionalButtons = new ArrayList<>();
            Collection<CompiledObjectCollectionView> compiledObjectCollectionViews = getCompiledGuiProfile().findAllApplicableArchetypeViews(getType(), OperationTypeType.ADD);
            if (CollectionUtils.isNotEmpty(compiledObjectCollectionViews)) {
                compiledObjectCollectionViews.forEach(collection -> {
                    CompositedIconButtonDto buttonDesc = new CompositedIconButtonDto();
                    buttonDesc.setCompositedIcon(createCompositedIcon(collection));
                    buttonDesc.setOrCreateDefaultAdditionalButtonDisplayType(collection.getDisplay());
                    buttonDesc.setCollectionView(collection);
                    additionalButtons.add(buttonDesc);
                });
            }
            if (isGenericNewButtonVisible()) {
                CompositedIconButtonDto defaultButton = new CompositedIconButtonDto();
                DisplayType defaultButtonDisplayType = getDefaultButtonDisplayType();
                defaultButton.setAdditionalButtonDisplayType(defaultButtonDisplayType);
                CompositedIconBuilder defaultButtonIconBuilder = new CompositedIconBuilder();
                defaultButtonIconBuilder.setBasicIcon(WebComponentUtil.getIconCssClass(defaultButtonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(defaultButtonDisplayType));
                defaultButton.setCompositedIcon(defaultButtonIconBuilder.build());
                additionalButtons.add(defaultButton);
            }
            MultiFunctinalButtonDto multifunctionalButton = new MultiFunctinalButtonDto();
            multifunctionalButton.setAdditionalButtons(additionalButtons);
            return multifunctionalButton;
        }
    };
}
Also used : CompositedIconButtonDto(com.evolveum.midpoint.web.component.CompositedIconButtonDto) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) ArrayList(java.util.ArrayList) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder) MultiFunctinalButtonDto(com.evolveum.midpoint.web.component.MultiFunctinalButtonDto)

Example 3 with CompositedIconButtonDto

use of com.evolveum.midpoint.web.component.CompositedIconButtonDto in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method createCompositedIconButtonDto.

private CompositedIconButtonDto createCompositedIconButtonDto(DisplayType buttonDisplayType, AssignmentObjectRelation relation, CompositedIcon icon) {
    CompositedIconButtonDto compositedIconButtonDto = new CompositedIconButtonDto();
    compositedIconButtonDto.setAdditionalButtonDisplayType(buttonDisplayType);
    if (icon != null) {
        compositedIconButtonDto.setCompositedIcon(icon);
    } else {
        CompositedIconBuilder mainButtonIconBuilder = new CompositedIconBuilder();
        mainButtonIconBuilder.setBasicIcon(WebComponentUtil.getIconCssClass(buttonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(buttonDisplayType));
        compositedIconButtonDto.setCompositedIcon(mainButtonIconBuilder.build());
    }
    compositedIconButtonDto.setAssignmentObjectRelation(relation);
    return compositedIconButtonDto;
}
Also used : CompositedIconButtonDto(com.evolveum.midpoint.web.component.CompositedIconButtonDto) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)

Example 4 with CompositedIconButtonDto

use of com.evolveum.midpoint.web.component.CompositedIconButtonDto in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method createCompositedIconButtonDto.

private CompositedIconButtonDto createCompositedIconButtonDto(DisplayType buttonDisplayType, AssignmentObjectRelation relation, CompositedIcon icon) {
    CompositedIconButtonDto compositedIconButtonDto = new CompositedIconButtonDto();
    compositedIconButtonDto.setAdditionalButtonDisplayType(buttonDisplayType);
    if (icon != null) {
        compositedIconButtonDto.setCompositedIcon(icon);
    } else {
        CompositedIconBuilder mainButtonIconBuilder = new CompositedIconBuilder();
        mainButtonIconBuilder.setBasicIcon(WebComponentUtil.getIconCssClass(buttonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(buttonDisplayType));
        compositedIconButtonDto.setCompositedIcon(mainButtonIconBuilder.build());
    }
    compositedIconButtonDto.setAssignmentObjectRelation(relation);
    return compositedIconButtonDto;
}
Also used : CompositedIconButtonDto(com.evolveum.midpoint.web.component.CompositedIconButtonDto) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)

Example 5 with CompositedIconButtonDto

use of com.evolveum.midpoint.web.component.CompositedIconButtonDto in project midpoint by Evolveum.

the class CreateTemplatePanel method loadButtonDescriptions.

protected LoadableModel<MultiFunctinalButtonDto> loadButtonDescriptions() {
    return new LoadableModel<>(false) {

        @Override
        protected MultiFunctinalButtonDto load() {
            List<CompositedIconButtonDto> additionalButtons = new ArrayList<>();
            Collection<CompiledObjectCollectionView> compiledObjectCollectionViews = findAllApplicableArchetypeViews();
            if (CollectionUtils.isNotEmpty(compiledObjectCollectionViews)) {
                compiledObjectCollectionViews.forEach(collection -> {
                    CompositedIconButtonDto buttonDesc = new CompositedIconButtonDto();
                    buttonDesc.setCompositedIcon(createCompositedIcon(collection));
                    buttonDesc.setOrCreateDefaultAdditionalButtonDisplayType(collection.getDisplay());
                    buttonDesc.setCollectionView(collection);
                    additionalButtons.add(buttonDesc);
                });
            }
            MultiFunctinalButtonDto multifunctionalButton = new MultiFunctinalButtonDto();
            multifunctionalButton.setAdditionalButtons(additionalButtons);
            return multifunctionalButton;
        }
    };
}
Also used : CompositedIconButtonDto(com.evolveum.midpoint.web.component.CompositedIconButtonDto) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) ArrayList(java.util.ArrayList) MultiFunctinalButtonDto(com.evolveum.midpoint.web.component.MultiFunctinalButtonDto)

Aggregations

CompositedIconButtonDto (com.evolveum.midpoint.web.component.CompositedIconButtonDto)10 CompositedIconBuilder (com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)9 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)4 MultiFunctinalButtonDto (com.evolveum.midpoint.web.component.MultiFunctinalButtonDto)4 AssignmentObjectRelation (com.evolveum.midpoint.model.api.AssignmentObjectRelation)3 IconCssStyle (com.evolveum.midpoint.gui.impl.component.icon.IconCssStyle)2 CompiledObjectCollectionView (com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView)2 DisplayType (com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType)2 ArrayList (java.util.ArrayList)2 CompositedIcon (com.evolveum.midpoint.gui.impl.component.icon.CompositedIcon)1 PolyStringType (com.evolveum.prism.xml.ns._public.types_3.PolyStringType)1