use of com.haulmont.cuba.gui.components.Formatter in project cuba by cuba-platform.
the class DesktopAbstractTable method addColumn.
@Override
public void addColumn(Column column) {
checkNotNullArgument(column, "Column must be non null");
Object columnId = column.getId();
columns.put(columnId, column);
columnsOrder.add(column);
if (tableModel != null) {
tableModel.addColumn(column);
}
if (datasource != null && column.isEditable() && columnId instanceof MetaPropertyPath) {
if (!editableColumns.contains(columnId)) {
editableColumns.add((MetaPropertyPath) columnId);
}
}
setColumnIdentifiers();
refresh();
column.setOwner(this);
if (column.getFormatter() == null && columnId instanceof MetaPropertyPath) {
MetaProperty metaProperty = ((MetaPropertyPath) columnId).getMetaProperty();
if (Collection.class.isAssignableFrom(metaProperty.getJavaType())) {
final Formatter collectionFormatter = new CollectionFormatter();
column.setFormatter(collectionFormatter);
}
}
}
Aggregations