Interface GroupCellValueFormatter<E>

Type Parameters:
E - item type
All Superinterfaces:
Serializable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface GroupCellValueFormatter<E> extends Serializable
Interface for formatting group cell values. The formatting is applied only for group data grid columns.

If a group data grid column does not have a custom renderer, the formatter is used to format the cell value. The formatted value will also be exported to Excel using export actions.

If a group data grid column has a custom group component renderer, the formatter is not used. The formatter will only be applied during export to Excel using export actions.

For instance, setting formatter for group column cell value:

 @Install(to = "customersDataGrid.group", subject = "groupCellValueFormatter")
 public String groupColumnCellFormatter(GroupCellValueFormatter.GroupCellContext<Customer> context) {
     GroupInfo groupInfo = context.getGroupInfo();
     GroupProperty property = groupInfo.getProperty();

     if (property.is("grade")) {
         return "Customer grade: " + groupInfo.getValue();
     } else {
         return "Country: " + metadataTools.getInstanceName(groupInfo.getValue());
     }
 }