use of com.evolveum.midpoint.gui.impl.component.icon.IconCssStyle in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method loadMultiFunctionalButtonModel.
protected LoadableModel<MultiFunctinalButtonDto> loadMultiFunctionalButtonModel(boolean useDefaultObjectRelations) {
return new LoadableModel<>(false) {
@Override
protected MultiFunctinalButtonDto load() {
MultiFunctinalButtonDto multiFunctinalButtonDto = new MultiFunctinalButtonDto();
DisplayType mainButtonDisplayType = getCreateMemberButtonDisplayType();
CompositedIconBuilder builder = new CompositedIconBuilder();
Map<IconCssStyle, IconType> layerIcons = WebComponentUtil.createMainButtonLayerIcon(mainButtonDisplayType);
for (Map.Entry<IconCssStyle, IconType> icon : layerIcons.entrySet()) {
builder.appendLayerIcon(icon.getValue(), icon.getKey());
}
CompositedIconButtonDto mainButton = createCompositedIconButtonDto(mainButtonDisplayType, null, builder.build());
multiFunctinalButtonDto.setMainButton(mainButton);
List<AssignmentObjectRelation> loadedRelations = loadMemberRelationsList();
if (CollectionUtils.isEmpty(loadedRelations) && useDefaultObjectRelations) {
loadedRelations.addAll(getDefaultNewMemberRelations());
}
List<CompositedIconButtonDto> additionalButtons = new ArrayList<>();
if (CollectionUtils.isNotEmpty(loadedRelations)) {
List<AssignmentObjectRelation> relations = WebComponentUtil.divideAssignmentRelationsByAllValues(loadedRelations);
relations.forEach(relation -> {
DisplayType additionalButtonDisplayType = GuiDisplayTypeUtil.getAssignmentObjectRelationDisplayType(getPageBase(), relation, "abstractRoleMemberPanel.menu.createMember");
CompositedIconButtonDto buttonDto = createCompositedIconButtonDto(additionalButtonDisplayType, relation, createCompositedIcon(relation, additionalButtonDisplayType));
additionalButtons.add(buttonDto);
});
}
multiFunctinalButtonDto.setAdditionalButtons(additionalButtons);
return multiFunctinalButtonDto;
}
};
}
use of com.evolveum.midpoint.gui.impl.component.icon.IconCssStyle in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method loadMultiFunctionalButtonModel.
protected LoadableModel<MultiFunctinalButtonDto> loadMultiFunctionalButtonModel(boolean useDefaultObjectRelations) {
return new LoadableModel<>(false) {
@Override
protected MultiFunctinalButtonDto load() {
MultiFunctinalButtonDto multiFunctinalButtonDto = new MultiFunctinalButtonDto();
DisplayType mainButtonDisplayType = getCreateMemberButtonDisplayType();
CompositedIconBuilder builder = new CompositedIconBuilder();
Map<IconCssStyle, IconType> layerIcons = WebComponentUtil.createMainButtonLayerIcon(mainButtonDisplayType);
for (Map.Entry<IconCssStyle, IconType> icon : layerIcons.entrySet()) {
builder.appendLayerIcon(icon.getValue(), icon.getKey());
}
CompositedIconButtonDto mainButton = createCompositedIconButtonDto(mainButtonDisplayType, null, builder.build());
multiFunctinalButtonDto.setMainButton(mainButton);
List<AssignmentObjectRelation> loadedRelations = loadMemberRelationsList();
if (CollectionUtils.isEmpty(loadedRelations) && useDefaultObjectRelations) {
loadedRelations.addAll(getDefaultNewMemberRelations());
}
List<CompositedIconButtonDto> additionalButtons = new ArrayList<>();
if (CollectionUtils.isNotEmpty(loadedRelations)) {
List<AssignmentObjectRelation> relations = WebComponentUtil.divideAssignmentRelationsByAllValues(loadedRelations);
relations.forEach(relation -> {
DisplayType additionalButtonDisplayType = GuiDisplayTypeUtil.getAssignmentObjectRelationDisplayType(getPageBase(), relation, "abstractRoleMemberPanel.menu.createMember");
CompositedIconButtonDto buttonDto = createCompositedIconButtonDto(additionalButtonDisplayType, relation, createCompositedIcon(relation, additionalButtonDisplayType));
additionalButtons.add(buttonDto);
});
}
multiFunctinalButtonDto.setAdditionalButtons(additionalButtons);
return multiFunctinalButtonDto;
}
};
}
Aggregations