use of com.evolveum.midpoint.web.component.CompositedIconButtonDto in project midpoint by Evolveum.
the class BasicMultivalueContainerListPanel method createNewButtonDescription.
@Override
protected List<CompositedIconButtonDto> createNewButtonDescription() {
String title = getPageBase().createStringResource("PageAdminObjectDetails.title.new", getContainerNameForNewButton()).getString();
DisplayType defaultButtonDisplayType = GuiDisplayTypeUtil.createDisplayType("fa fa-plus", "green", title);
CompositedIconButtonDto defaultButton = new CompositedIconButtonDto();
CompositedIconBuilder builder = new CompositedIconBuilder();
builder.setBasicIcon(WebComponentUtil.getIconCssClass(defaultButtonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(defaultButtonDisplayType));
defaultButton.setAdditionalButtonDisplayType(defaultButtonDisplayType);
defaultButton.setCompositedIcon(builder.build());
return Collections.singletonList(defaultButton);
}
use of com.evolveum.midpoint.web.component.CompositedIconButtonDto 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.web.component.CompositedIconButtonDto 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.web.component.CompositedIconButtonDto in project midpoint by Evolveum.
the class AssignmentPopup method createCompositedButtonForAssignmentRelation.
private CompositedIconButtonDto createCompositedButtonForAssignmentRelation(AssignmentObjectRelation relation) {
CompositedIconButtonDto buttonDto = new CompositedIconButtonDto();
buttonDto.setAssignmentObjectRelation(relation);
DisplayType additionalButtonDisplayType = GuiDisplayTypeUtil.getAssignmentObjectRelationDisplayType(getPageBase(), relation, "AssignmentPanel.newAssignmentTitle");
// isInducement() ? "AssignmentPanel.newInducementTitle" : "AssignmentPanel.newAssignmentTitle");
buttonDto.setAdditionalButtonDisplayType(additionalButtonDisplayType);
CompositedIconBuilder builder = WebComponentUtil.getAssignmentRelationIconBuilder(getPageBase(), relation, additionalButtonDisplayType.getIcon(), WebComponentUtil.createIconType(GuiStyleConstants.EVO_ASSIGNMENT_ICON, "green"));
CompositedIcon icon = null;
if (builder != null) {
icon = builder.build();
}
buttonDto.setCompositedIcon(icon);
return buttonDto;
}
use of com.evolveum.midpoint.web.component.CompositedIconButtonDto in project midpoint by Evolveum.
the class AssignmentPopup method newButtonDescription.
private List<CompositedIconButtonDto> newButtonDescription() {
if (getModelObject() == null) {
return null;
}
List<AssignmentObjectRelation> relations = getModelObject().getAssignmentObjectRelation();
if (relations == null) {
return null;
}
List<CompositedIconButtonDto> buttonDtoList = new ArrayList<>();
relations.forEach(relation -> buttonDtoList.add(createCompositedButtonForAssignmentRelation(relation)));
if (isGenericNewObjectButtonVisible()) {
DisplayType defaultButtonDisplayType = GuiDisplayTypeUtil.createDisplayType(GuiStyleConstants.EVO_ASSIGNMENT_ICON, "green", createStringResource("AssignmentPanel.defaultAssignment").getString(), createStringResource("AssignmentPanel.newAssignmentTitle", "", "").getString());
// AssignmentPanel.this.createStringResource(isInducement() ?
// "AssignmentPanel.newInducementTitle" : "AssignmentPanel.newAssignmentTitle", "", "").getString());
CompositedIconButtonDto defaultButton = new CompositedIconButtonDto();
CompositedIconBuilder builder = new CompositedIconBuilder();
builder.setBasicIcon(WebComponentUtil.getIconCssClass(defaultButtonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(defaultButtonDisplayType)).appendLayerIcon(WebComponentUtil.createIconType(GuiStyleConstants.CLASS_PLUS_CIRCLE, "green"), IconCssStyle.BOTTOM_RIGHT_STYLE);
defaultButton.setAdditionalButtonDisplayType(defaultButtonDisplayType);
defaultButton.setCompositedIcon(builder.build());
buttonDtoList.add(defaultButton);
}
return buttonDtoList;
}
Aggregations