use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder 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;
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class ChooseMemberPopup method getAssignButtonDescription.
private List<CompositedIconButtonDto> getAssignButtonDescription() {
List<CompositedIconButtonDto> additionalAssignmentButtons = new ArrayList<>();
List<AssignmentObjectRelation> assignmentObjectRelations = WebComponentUtil.divideAssignmentRelationsByAllValues(loadMemberRelationsList());
if (assignmentObjectRelations != null) {
assignmentObjectRelations.forEach(relation -> {
DisplayType additionalDispayType = GuiDisplayTypeUtil.getAssignmentObjectRelationDisplayType(ChooseMemberPopup.this.getPageBase(), relation, "abstractRoleMemberPanel.menu.assignMember");
CompositedIconBuilder builder = WebComponentUtil.getAssignmentRelationIconBuilder(ChooseMemberPopup.this.getPageBase(), relation, additionalDispayType.getIcon(), WebComponentUtil.createIconType(GuiStyleConstants.EVO_ASSIGNMENT_ICON, "green"));
CompositedIcon icon = builder.build();
CompositedIconButtonDto buttonDto = createCompositedIconButtonDto(additionalDispayType, relation, icon);
additionalAssignmentButtons.add(buttonDto);
});
}
additionalAssignmentButtons.add(createCompositedIconButtonDto(getAssignMemberButtonDisplayType(), null, null));
return additionalAssignmentButtons;
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class MainObjectListPanel method createCreateReportButton.
private AjaxCompositedIconButton createCreateReportButton(String buttonId) {
final CompositedIconBuilder builder = new CompositedIconBuilder();
builder.setBasicIcon(WebComponentUtil.createReportIcon(), IconCssStyle.IN_ROW_STYLE);
IconType plusIcon = new IconType();
plusIcon.setCssClass(GuiStyleConstants.CLASS_ADD_NEW_OBJECT);
plusIcon.setColor("green");
builder.appendLayerIcon(plusIcon, LayeredIconCssStyle.BOTTOM_RIGHT_STYLE);
AjaxCompositedIconButton createReport = new AjaxCompositedIconButton(buttonId, builder.build(), getPageBase().createStringResource("MainObjectListPanel.createReport")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
createReportPerformed(target);
}
};
createReport.add(AttributeAppender.append("class", "btn btn-default btn-sm btn-margin-right"));
createReport.add(new VisibleBehaviour(() -> WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_CREATE_REPORT_BUTTON_URI)));
return createReport;
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder 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);
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class PageWorkItemsClaimable method createRowActions.
@Override
protected List<InlineMenuItem> createRowActions() {
List<InlineMenuItem> menu = new ArrayList<>();
menu.add(new ButtonInlineMenuItem(createStringResource("pageWorkItem.button.claim")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<PrismContainerValueWrapper<CaseWorkItemType>>() {
@Override
public void onClick(AjaxRequestTarget target) {
claimWorkItemPerformed(getRowModel(), target);
}
};
}
@Override
public IModel<Boolean> getEnabled() {
IModel<PrismContainerValueWrapper<CaseWorkItemType>> rowModel = ((ColumnMenuAction<PrismContainerValueWrapper<CaseWorkItemType>>) getAction()).getRowModel();
if (rowModel != null && rowModel.getObject() != null && rowModel.getObject().getRealValue() != null) {
CaseWorkItemType workItem = rowModel.getObject().getRealValue();
return Model.of(CaseWorkItemUtil.isCaseWorkItemNotClosed(workItem));
} else {
return super.getEnabled();
}
}
@Override
public IModel<String> getConfirmationMessageModel() {
return createStringResource("CaseWorkItemsPanel.confirmWorkItemsClaimAction");
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_ICON_CLAIM);
}
});
return menu;
}
Aggregations