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;
}
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;
}
};
}
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;
}
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;
}
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;
}
};
}
Aggregations