use of com.haulmont.chile.core.annotations.MetaProperty in project cuba by cuba-platform.
the class EntitySnapshot method getLabel.
@MetaProperty(related = { "snapshotDate,author" })
public String getLabel() {
String name = "";
if (author != null && StringUtils.isNotEmpty(this.author.getCaption())) {
name += this.author.getCaption() + " ";
}
Datatype datatype = Datatypes.getNN(Date.class);
UserSessionSource userSessionSource = AppBeans.get(UserSessionSource.NAME);
if (userSessionSource != null && userSessionSource.checkCurrentUserSession()) {
name += datatype.format(snapshotDate, userSessionSource.getLocale());
}
return StringUtils.trim(name);
}
use of com.haulmont.chile.core.annotations.MetaProperty in project cuba by cuba-platform.
the class EntityLogAttr method getDisplayName.
@MetaProperty
public String getDisplayName() {
String entityName = getLogItem().getEntity();
String message;
com.haulmont.chile.core.model.MetaClass metaClass = getClassFromEntityName(entityName);
if (metaClass != null) {
Messages messages = AppBeans.get(Messages.NAME);
message = messages.getTools().getPropertyCaption(metaClass, getName());
} else {
return getName();
}
return (message != null ? message : getName());
}
use of com.haulmont.chile.core.annotations.MetaProperty in project cuba by cuba-platform.
the class ScheduledTask method getMethodParametersString.
@MetaProperty
public String getMethodParametersString() {
StringBuilder sb = new StringBuilder();
int count = 0;
List<MethodParameterInfo> parameters = getMethodParameters();
for (MethodParameterInfo param : parameters) {
sb.append(param.getType().getSimpleName()).append(" ").append(param.getName()).append(" = ").append(param.getValue());
if (++count != parameters.size())
sb.append(", ");
}
return sb.toString();
}
Aggregations