use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.
the class ObjectReferenceColumnPanel method getIconDisplayType.
private DisplayType getIconDisplayType() {
ObjectReferenceType ref = getModelObject();
if (ref == null || ref.getType() == null) {
return GuiDisplayTypeUtil.createDisplayType("");
}
ObjectTypeGuiDescriptor guiDescriptor = getObjectTypeDescriptor(ref.getType());
String icon = guiDescriptor != null ? guiDescriptor.getBlackIcon() : ObjectTypeGuiDescriptor.ERROR_ICON;
// }
return GuiDisplayTypeUtil.createDisplayType(icon);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.
the class CreateTemplatePanel method createCompositedIcon.
// TODO copied from MainObjectListPanel
private CompositedIcon createCompositedIcon(CompiledObjectCollectionView collectionView) {
DisplayType additionalButtonDisplayType = GuiDisplayTypeUtil.getNewObjectDisplayTypeFromCollectionView(collectionView, getPageBase());
CompositedIconBuilder builder = new CompositedIconBuilder();
builder.setBasicIcon(WebComponentUtil.getIconCssClass(additionalButtonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(additionalButtonDisplayType));
return builder.build();
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.
the class CreateTemplatePanel method getDefaultButtonDisplayType.
private DisplayType getDefaultButtonDisplayType() {
String iconCssStyle = WebComponentUtil.createDefaultBlackIcon(getType());
String sb = createStringResource("MainObjectListPanel.newObject").getString() + " " + createStringResource("ObjectTypeLowercase." + getType().getLocalPart()).getString();
DisplayType display = GuiDisplayTypeUtil.createDisplayType(iconCssStyle, "", sb);
display.setLabel(WebComponentUtil.createPolyFromOrigString(getType().getLocalPart(), "ObjectType." + getType().getLocalPart()));
return display;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.
the class GlobalPolicyRuleTabPanel method initBasicColumns.
private List<IColumn<PrismContainerValueWrapper<GlobalPolicyRuleType>, String>> initBasicColumns() {
List<IColumn<PrismContainerValueWrapper<GlobalPolicyRuleType>, String>> columns = new ArrayList<>();
columns.add(new CheckBoxHeaderColumn<>());
PrismPropertyWrapperColumn<GlobalPolicyRuleType, String> linkColumn = new PrismPropertyWrapperColumn<GlobalPolicyRuleType, String>(getModel(), GlobalPolicyRuleType.F_NAME, ColumnType.LINK, getPageBase()) {
@Override
protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<GlobalPolicyRuleType>> rowModel) {
getMultivalueContainerListPanel().itemDetailsPerformed(target, rowModel);
}
protected DisplayType getIconDisplayType(IModel<PrismContainerValueWrapper<GlobalPolicyRuleType>> rowModel) {
return GuiDisplayTypeUtil.createDisplayType(WebComponentUtil.createDefaultBlackIcon(SystemConfigurationType.COMPLEX_TYPE));
}
};
columns.add(linkColumn);
columns.add(new PrismContainerWrapperColumn<>(getModel(), GlobalPolicyRuleType.F_POLICY_CONSTRAINTS, getPageBase()));
columns.add(new PrismContainerWrapperColumn<>(getModel(), GlobalPolicyRuleType.F_POLICY_ACTIONS, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<GlobalPolicyRuleType, String>(getModel(), GlobalPolicyRuleType.F_POLICY_SITUATION, ColumnType.STRING, getPageBase()));
List<InlineMenuItem> menuActionsList = getMultivalueContainerListPanel().getDefaultMenuActions();
columns.add(new InlineMenuButtonColumn(menuActionsList, getPageBase()) {
private static final long serialVersionUID = 1L;
@Override
public String getCssClass() {
return " col-md-1 ";
}
});
return columns;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType 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);
}
Aggregations