use of io.jmix.ui.component.data.meta.EntityTableItems in project jmix by jmix-framework.
the class AbstractTable method generateCellStyle.
@Nullable
protected String generateCellStyle(@Nullable Object itemId, @Nullable Object propertyId) {
String style = null;
if (propertyId != null && itemId != null && !component.isColumnEditable(propertyId) && (component.getColumnGenerator(propertyId) == null || isValueGeneratedColumn(propertyId))) {
MetaPropertyPath propertyPath;
if (propertyId instanceof MetaPropertyPath) {
propertyPath = (MetaPropertyPath) propertyId;
} else {
EntityTableItems<E> entityTableSource = (EntityTableItems<E>) getItems();
propertyPath = entityTableSource != null ? entityTableSource.getEntityMetaClass().getPropertyPath(propertyId.toString()) : null;
}
style = generateDefaultCellStyle(itemId, propertyId, propertyPath);
}
if (styleProviders != null) {
String generatedStyle = getGeneratedCellStyle(itemId, propertyId);
// all cells with custom styles will have v-table-cell-content-cs style name in class
if (style != null) {
if (generatedStyle != null) {
style = CUSTOM_STYLE_NAME_PREFIX + generatedStyle + " " + style;
}
} else if (generatedStyle != null) {
style = CUSTOM_STYLE_NAME_PREFIX + generatedStyle;
}
}
return style == null ? null : (CUSTOM_STYLE_NAME_PREFIX + style);
}
Aggregations