use of com.haulmont.cuba.gui.components.filter.dateinterval.DateIntervalValue in project cuba by cuba-platform.
the class AppliedFilter method formatParamValue.
protected String formatParamValue(Param param) {
Object value = param.getValue();
if (value == null)
return "";
if (param.isDateInterval()) {
DateIntervalValue dateIntervalValue = AppBeans.getPrototype(DateIntervalValue.NAME, (String) value);
return dateIntervalValue.getLocalizedValue();
}
if (value instanceof Instance)
return ((Instance) value).getInstanceName();
if (value instanceof Enum)
return messages.getMessage((Enum) value);
if (value instanceof ArrayList) {
ArrayList<String> names = new ArrayList<>();
ArrayList list = ((ArrayList) value);
for (Object obj : list) {
if (obj instanceof Instance)
names.add(((Instance) obj).getInstanceName());
else {
names.add(FilterConditionUtils.formatParamValue(param, obj));
}
}
return names.toString();
}
return FilterConditionUtils.formatParamValue(param, value);
}
Aggregations