use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.
the class GenericSupport method getLabel.
static <C extends Containerable> String getLabel(GuiObjectColumnType column, PrismContainerDefinition<C> objectDefinition, LocalizationService localizationService) {
ItemPath path = column.getPath() == null ? null : column.getPath().getItemPath();
DisplayType columnDisplay = column.getDisplay();
String label;
if (columnDisplay != null && columnDisplay.getLabel() != null) {
label = getMessage(localizationService, columnDisplay.getLabel().getOrig());
} else {
String name = column.getName();
String displayName = null;
if (path != null) {
ItemDefinition<Item<?, ?>> def = objectDefinition.findItemDefinition(path);
if (def == null) {
throw new IllegalArgumentException("Could'n find item for path " + path);
}
displayName = def.getDisplayName();
}
if (StringUtils.isNotEmpty(displayName)) {
label = getMessage(localizationService, displayName);
} else {
label = name;
}
}
return label;
}
Aggregations