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 Details

    • LocalizedRoleColumnsSupport

      public LocalizedRoleColumnsSupport()
  • Method Details

    • install

      public <M extends BaseRoleModel> void install(DataGrid<M> grid)
      Gives the name and the description columns 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

      public <M extends BaseRoleModel> List<M> sortByName(Collection<M> roleModels)
      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