Class CollectionContainerSortManager

java.lang.Object
io.jmix.flowui.model.CollectionContainerSortManager

@Component("flowui_CollectionContainerSortManager") public class CollectionContainerSortManager extends Object
Creates sorters for collection containers.

The manager asks CollectionContainerSortProvider beans in Spring order and uses the first non-null sorter. If no provider supports the context, it delegates to SorterFactory.

  • Field Details

  • Constructor Details

    • CollectionContainerSortManager

      public CollectionContainerSortManager(SorterFactory sorterFactory, org.springframework.beans.factory.ObjectProvider<CollectionContainerSortProvider> sortProviders)
      Creates a collection container sort manager.
      Parameters:
      sorterFactory - fallback factory used if no provider returns a sorter
      sortProviders - provider beans that can supply sorters
  • Method Details

    • createCollectionContainerSorter

      public Sorter createCollectionContainerSorter(CollectionContainer<?> container)
      Creates a sorter for the specified collection container.
      Parameters:
      container - collection container for which a sorter is created
      Returns:
      sorter supplied by a provider, or a fallback sorter created by SorterFactory
    • createCollectionContainerSorter

      public Sorter createCollectionContainerSorter(CollectionContainer<?> container, @Nullable BaseCollectionLoader loader)
      Creates a sorter for the specified collection container and loader.
      Parameters:
      container - collection container for which a sorter is created
      loader - collection loader associated with the container, or null if there is no loader
      Returns:
      sorter supplied by a provider, or a fallback sorter created by SorterFactory
    • createCollectionContainerSorterInternal

      protected Sorter createCollectionContainerSorterInternal(CollectionContainer<?> container, @Nullable BaseCollectionLoader loader)
      Creates a sorter using providers or a fallback factory.
      Parameters:
      container - collection container for which a sorter is created
      loader - collection loader associated with the container, or null if there is no loader
      Returns:
      sorter supplied by a provider, or a fallback sorter created by SorterFactory
    • createFallbackSorter

      protected Sorter createFallbackSorter(CollectionContainer<?> container, @Nullable BaseCollectionLoader loader)