Class ItemsPerPage

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
io.jmix.flowui.kit.component.pagination.JmixItemsPerPage
io.jmix.flowui.component.pagination.ItemsPerPage
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasStyle, Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class ItemsPerPage extends JmixItemsPerPage implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, com.vaadin.flow.component.HasEnabled
See Also:
  • Field Details

    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • messages

      protected Messages messages
    • componentProperties

      protected UiComponentProperties componentProperties
    • uiProperties

      protected UiProperties uiProperties
    • loader

      protected PaginationDataLoader loader
    • processedItems

      protected List<Integer> processedItems
  • Constructor Details

    • ItemsPerPage

      public ItemsPerPage()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • autowireDependencies

      protected void autowireDependencies()
    • initComponent

      protected void initComponent()
    • setPaginationLoader

      public void setPaginationLoader(@Nullable PaginationDataLoader loader)
      Sets loader to the component.
      Parameters:
      loader - loader to set
    • addItemsPerPageValueChangeListener

      public com.vaadin.flow.shared.Registration addItemsPerPageValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.select.Select<Integer>,Integer>> listener)
      Adds listener to handle items per page value change event.
      Parameters:
      listener - listener to add
      Returns:
      a registration object for removing an event listener
    • getItemsPerPageValue

      protected int getItemsPerPageValue()
      Returns:
      current items count for page
    • setItemsPerPageValue

      protected void setItemsPerPageValue(@Nullable Integer value)
    • initItemsPerPageOptions

      protected void initItemsPerPageOptions()
    • initMaxResultValue

      protected void initMaxResultValue()
      Setup MaxResult value to data binder and to items per page ComboBox if it's visible.
    • processOptions

      protected List<Integer> processOptions(List<Integer> options, MetaClass metaClass)
      Sorts options. Options less than or equal 0 are ignored. Values greater than MaxFetchSize are replaced by MaxFetchSize.
      Parameters:
      options - items per page options
      metaClass - entity's MetaClass
      Returns:
      sorted options
    • getEntityMaxFetchSize

      protected int getEntityMaxFetchSize(MetaClass metaClass)
    • getEntityPageSize

      protected int getEntityPageSize(MetaClass metaClass)
    • getDefaultItemValue

      protected Integer getDefaultItemValue(List<Integer> options, MetaClass metaClass)
    • findClosestValue

      protected int findClosestValue(int maxResults, List<Integer> optionsList)
    • isItemsPerPageVisible

      protected boolean isItemsPerPageVisible()
    • containsItem

      protected boolean containsItem(@Nullable Integer item)