protected void fillAttributeSelect(Category category) { UUID attrId = condition.getCategoryAttributeId(); CategoryAttribute selectedAttribute = null; Map<String, CategoryAttribute> attributesMap = new TreeMap<>(); for (CategoryAttribute attribute : category.getCategoryAttrs()) { attributesMap.put(attribute.getLocaleName(), attribute); if (attribute.getId().equals(attrId)) { selectedAttribute = attribute; } } attributeLookup.setOptionsMap(attributesMap); attributeLookup.setValue(selectedAttribute); }
protected String getColumnCaption(Object columnId, Column column) { String caption = column.getCaption(); if (caption != null) { return caption; } if (!(columnId instanceof MetaPropertyPath)) { return StringUtils.capitalize(getColumnCaption(columnId)); } MetaPropertyPath mpp = (MetaPropertyPath) columnId; MetaProperty metaProperty = mpp.getMetaProperty(); if (DynamicAttributesUtils.isDynamicAttribute(metaProperty)) { CategoryAttribute categoryAttribute = DynamicAttributesUtils.getCategoryAttribute(metaProperty); if (LocaleHelper.isLocalizedValueDefined(categoryAttribute.getLocaleNames())) { return categoryAttribute.getLocaleName(); } caption = StringUtils.capitalize(categoryAttribute.getName()); } else { caption = StringUtils.capitalize(getColumnCaption(columnId)); } return caption; }
categoryAttribute.getLocaleName() : StringUtils.capitalize(categoryAttribute.getName()); } else {
@Override public String getLocCaption() { if (isBlank(caption) && !isBlank(propertyPath)) { MessageTools messageTools = AppBeans.get(MessageTools.class); String propertyCaption = messageTools.getPropertyCaption(metaClass, propertyPath); if (!isBlank(propertyCaption)) { return propertyCaption + "." + locCaption; } } else if (isNotBlank(caption)) { MessageTools messageTools = AppBeans.get(MessageTools.class); return messageTools.loadString(messagesPack, caption); } MetaPropertyPath mpp = DynamicAttributesUtils.getMetaPropertyPath(metaClass, getCategoryAttributeId()); if (mpp != null) { return DynamicAttributesUtils.getCategoryAttribute(mpp.getMetaProperty()).getLocaleName(); } return super.getLocCaption(); } }
CategoryAttribute categoryAttribute = DynamicAttributesUtils.getCategoryAttribute(metaProperty); columnCaption = LocaleHelper.isLocalizedValueDefined(categoryAttribute.getLocaleNames()) ? categoryAttribute.getLocaleName() : StringUtils.capitalize(categoryAttribute.getName()); } else {
for (CategoryAttribute attribute : categoryAttributes) { MetaPropertyPath metaPropertyPath = DynamicAttributesUtils.getMetaPropertyPath(metaClass, attribute); String propertyCaption = attribute.getLocaleName();
attribute.getLocaleName() : StringUtils.capitalize(attribute.getName()));
protected List<FieldGroup.FieldConfig> createFieldsForAttributes(FieldGroup newRuntimeFieldGroup) { @SuppressWarnings("unchecked") Collection<DynamicAttributesMetaProperty> metaProperties = rds.getPropertiesFilteredByCategory(); List<FieldGroup.FieldConfig> fields = new ArrayList<>(metaProperties.size()); for (DynamicAttributesMetaProperty property : metaProperties) { FieldGroup.FieldConfig field = newRuntimeFieldGroup.createField(property.getName()); field.setProperty(property.getName()); CategoryAttribute attribute = property.getAttribute(); if (attribute != null) { field.setCaption(attribute.getLocaleName()); if (StringUtils.isNotBlank(attribute.getWidth())) { field.setWidth(attribute.getWidth()); } else { field.setWidth(fieldWidth); } } else { field.setCaption(property.getName()); field.setWidth(fieldWidth); } fields.add(field); } return fields; }
attribute.getLocaleName() : StringUtils.capitalize(attribute.getName()));
protected EntityPropertyDiff(com.haulmont.chile.core.model.MetaProperty metaProperty) { metaClassName = metaProperty.getDomain().getName(); propertyName = metaProperty.getName(); if (DynamicAttributesUtils.isDynamicAttribute(metaProperty)) { CategoryAttribute categoryAttribute = DynamicAttributesUtils.getCategoryAttribute(metaProperty); propertyCaption = categoryAttribute.getLocaleName(); } else { MessageTools messageTools = AppBeans.get(MessageTools.NAME); propertyCaption = messageTools.getPropertyCaption(metaProperty.getDomain(), metaProperty.getName()); } }
if (metaPropertyPath != null && DynamicAttributesUtils.isDynamicAttribute(metaPropertyPath.getMetaProperty())) { CategoryAttribute categoryAttribute = DynamicAttributesUtils.getCategoryAttribute(metaPropertyPath.getMetaProperty()); field.setCaption(categoryAttribute != null ? categoryAttribute.getLocaleName() : propertyName); } else { loadCaption(field, element);
((Component.HasCaption) dynamicAttrComponent).setCaption(attribute.getLocaleName()); ((Field) dynamicAttrComponent).setRequired(attribute.getRequired()); ((Field) dynamicAttrComponent).setRequiredMessage(getMessages() .formatMainMessage("validation.required.defaultMsg", attribute.getLocaleName()));
DynamicAttributesUtils.encodeAttributeCode(attribute.getCode())); field.setProperty(DynamicAttributesUtils.encodeAttributeCode(attribute.getCode())); field.setCaption(attribute.getLocaleName()); field.setDatasource(ds); field.setRequired(attribute.getRequired()); field.setRequiredMessage(getMessages().formatMainMessage( "validation.required.defaultMsg", attribute.getLocaleName())); loadWidth(field, attribute.getWidth());
CategoryAttribute categoryAttribute = getCategoryAttribute(metaPropertyPath.getMetaProperty()); ((Component.HasCaption) component).setCaption(categoryAttribute != null ? categoryAttribute.getLocaleName() : propertyName); } else {
condition.setCategoryAttributeId(attributeLookup.getValue().getId()); condition.setIsCollection(BooleanUtils.isTrue(attributeLookup.getValue().getIsCollection())); condition.setLocCaption(attribute.getLocaleName()); condition.setCaption(caption.getValue());