Class PaginationImpl

All Implemented Interfaces:
AttachNotifier, Component, Component.BelongToFrame, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper, HasContextHelp, HasDebugId, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer, Pagination, PaginationComponent, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class PaginationImpl extends AbstractPagination<JmixPagination> implements Pagination, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
  • Field Details

    • FIRST_PAGE

      protected static final int FIRST_PAGE
      See Also:
    • firstButtonClickRegistration

      protected com.vaadin.shared.Registration firstButtonClickRegistration
    • prevButtonClickRegistration

      protected com.vaadin.shared.Registration prevButtonClickRegistration
    • nextButtonClickRegistration

      protected com.vaadin.shared.Registration nextButtonClickRegistration
    • lastButtonClickRegistration

      protected com.vaadin.shared.Registration lastButtonClickRegistration
    • refreshing

      protected boolean refreshing
  • Constructor Details

    • PaginationImpl

      public PaginationImpl()
  • Method Details

    • createComponent

      protected JmixPagination createComponent()
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • initComponent

      protected void initComponent()
    • setDataBinder

      public void setDataBinder(PaginationDataBinder dataBinder)
      Description copied from interface: PaginationComponent
      Sets a data binder. It is used for managing data loading and dividing data to pages.
      Specified by:
      setDataBinder in interface PaginationComponent
      Overrides:
      setDataBinder in class AbstractPagination<JmixPagination>
    • removeListeners

      protected void removeListeners()
    • initListeners

      protected void initListeners()
    • getMaxVisiblePages

      public int getMaxVisiblePages()
      Specified by:
      getMaxVisiblePages in interface Pagination
      Returns:
      maximum number of visible pages.
    • setMaxVisiblePages

      public void setMaxVisiblePages(int maxVisiblePages)
      Description copied from interface: Pagination
      Sets the maximum number of visible pages. The component can have a lot of pages, but users will see a number of pages at once that corresponds to the maximum number of visible pages. For instance, the component has 10 pages and the maximum number of visible pages is 3, so users will see only 3 pages at once. The default value is 5.
      Specified by:
      setMaxVisiblePages in interface Pagination
    • addPageChangeListener

      public Subscription addPageChangeListener(Consumer<Pagination.PageChangeEvent> listener)
      Description copied from interface: Pagination
      Adds page change listener. It will be invoked when the user selects another page or clicks on navigation buttons (next, previous, etc).
      Specified by:
      addPageChangeListener in interface Pagination
      Parameters:
      listener - listener to add
      Returns:
      a registration object for removing an event listener
    • firePageChangeEvent

      protected void firePageChangeEvent(Integer previousPageNumber, Integer pageNumber)
    • onItemsPerPageValueChange

      protected void onItemsPerPageValueChange(com.vaadin.data.HasValue.ValueChangeEvent<Integer> event)
      Overrides:
      onItemsPerPageValueChange in class AbstractPagination<JmixPagination>
    • onFirstButtonClick

      protected void onFirstButtonClick(com.vaadin.ui.Button.ClickEvent event)
    • onPrevButtonClick

      protected void onPrevButtonClick(com.vaadin.ui.Button.ClickEvent event)
    • onNextButtonClick

      protected void onNextButtonClick(com.vaadin.ui.Button.ClickEvent event)
    • onLastButtonClick

      protected void onLastButtonClick(com.vaadin.ui.Button.ClickEvent event)
    • onCollectionChange

      protected void onCollectionChange(CollectionChangeType changeType)
    • refreshData

      protected boolean refreshData()
    • createPageButtons

      protected void createPageButtons()
    • createPageButtons

      protected void createPageButtons(int totalCount, int itemsToDisplay)
    • updateState

      protected void updateState()
    • getCurrentState

      protected AbstractPagination.State getCurrentState()
    • updateItemsPerPageAvailability

      protected void updateItemsPerPageAvailability()