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.
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());
}
}
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classRepresents the context for a group cell in a grouped data grid. -
Method Summary
Modifier and TypeMethodDescriptionformat(GroupCellValueFormatter.GroupCellContext<E> context) Formats the group cell value.
-
Method Details
-
format
Formats the group cell value.- Parameters:
context- group cell context- Returns:
- formatted group cell value
-