Package io.jmix.securityflowui.impl.role
Class LocalizedRoleColumnsSupport
java.lang.Object
io.jmix.securityflowui.impl.role.LocalizedRoleColumnsSupport
@Component("sec_LocalizedRoleColumnsSupport")
@NullMarked
public class LocalizedRoleColumnsSupport
extends Object
Shows the name and the description of role models in the user's locale in the data grids of the role views, and
orders role models by the name. The texts are compared ignoring case, as in-memory sorting compares strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<M extends BaseRoleModel>
voidGives thenameand thedescriptioncolumns of the grid, those it shows, a renderer of the text in the user's locale and a comparator by that text.<M extends BaseRoleModel>
List<M> sortByName(Collection<M> roleModels) Returns the role models ordered by the name in the user's locale, ignoring case.
-
Constructor Details
-
LocalizedRoleColumnsSupport
public LocalizedRoleColumnsSupport()
-
-
Method Details
-
install
Gives thenameand thedescriptioncolumns of the grid, those it shows, a renderer of the text in the user's locale and a comparator by that text. It fills in only what the view has not configured: a column keeps a renderer other than the default one of its property, a comparator set explicitly and whether it is sortable.- Type Parameters:
M- the type of the role models- Parameters:
grid- the grid of role models
-
sortByName
Returns the role models ordered by the name in the user's locale, ignoring case. The name of each model is resolved once.- Type Parameters:
M- the type of the role models- Parameters:
roleModels- the role models to order- Returns:
- a new list of the role models
-