Class SimplePagination
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.AbstractPagination
io.jmix.flowui.kit.component.pagination.JmixSimplePagination
io.jmix.flowui.component.pagination.SimplePagination
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,PaginationComponent<SimplePagination>,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class SimplePagination
extends JmixSimplePagination
implements PaginationComponent<SimplePagination>, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.jmix.flowui.component.PaginationComponent
PaginationComponent.AfterRefreshEvent<T extends AbstractPagination>, PaginationComponent.BeforeRefreshEvent<T extends AbstractPagination> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected CurrentAuthenticationprotected com.vaadin.flow.shared.Registrationprotected FlowuiPropertiesprotected ItemsPerPageprotected com.vaadin.flow.shared.Registrationprotected com.vaadin.flow.shared.Registrationprotected booleanprotected SimplePagination.Stateprotected PaginationDataLoaderprotected Messagesprotected com.vaadin.flow.shared.Registrationprotected Datatype<?>protected com.vaadin.flow.shared.Registrationprotected booleanprotected booleanprotected intprotected intprotected SimplePagination.Stateprotected Function<LoadContext,Integer> protected com.vaadin.flow.shared.Registrationprotected UiComponentsFields inherited from class io.jmix.flowui.kit.component.pagination.JmixSimplePagination
autoLoad, ROWS_STATUS_LINK_CLASS_NAME, rowsStatusSpan, SIMPLE_PAGINATION_CLASS_NAME, STATUS_BAR_CLASS_NAME, STATUS_SPAN_CLASS_NAME, statusBar, TOTAL_COUNT_SPAN_CLASS_NAME, totalCountSpanFields inherited from class io.jmix.flowui.kit.component.pagination.AbstractPagination
BASE_BUTTON_CLASS_NAME, componentBaseClassName, FIRST_BUTTON_CLASS_NAME, firstButton, jmixRowsPerPage, LAST_BUTTON_CLASS_NAME, lastButton, NEXT_BUTTON_CLASS_NAME, nextButton, PREV_BUTTON_CLASS_NAME, previousButton -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddAfterRefreshListener(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.AfterRefreshEvent<SimplePagination>> listener) Adds after refresh listener.com.vaadin.flow.shared.RegistrationaddBeforeRefreshListener(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.BeforeRefreshEvent<SimplePagination>> listener) Adds before refresh listener.voidprotected voidprotected Stringprotected booleancanSetUnlimitedValue(Integer value) protected ItemsPerPageprotected voidprotected voidprotected intgetEntityMaxFetchSize(MetaClass metaClass) protected Stringprotected intprotected voidprotected voidinitItemsPerPage(ItemsPerPage itemsPerPage) protected voidbooleanbooleanprotected booleanprotected voidprotected voidonFirstClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected voidonItemsPerPageValueChange(com.vaadin.flow.component.HasValue.ValueChangeEvent<Integer> event) protected voidonLastClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected voidonNextClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected voidonPreviousClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected voidonRefreshItems(CollectionChangeType changeType) protected voidonTotalCountLabelClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.html.Span> event) protected booleanprotected voidvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetItemsPerPageDefaultValue(Integer defaultValue) Sets default value for the select component.voidsetItemsPerPageItems(List<Integer> itemsPerPageItems) Sets items which should be used in the select component.voidsetItemsPerPageUnlimitedItemVisible(boolean unlimitedItemVisible) Sets visibility of unlimited (null) option value in the items per page select component.voidsetItemsPerPageVisible(boolean itemsPerPageVisible) Sets visibility of items per page select component.voidSets loader to the component.protected voidvoidsetTotalCountDelegate(Function<LoadContext, Integer> totalCountDelegate) Sets delegate which is used to get the total count of items.protected voidsetTotalCountLabelText(int totalCount) protected voidprotected voidprotected voidMethods inherited from class io.jmix.flowui.kit.component.pagination.JmixSimplePagination
createInnerBar, createNavigationButton, createStatusBar, createStatusSpan, createTotalCountSpan, getRowsStatusLabel, getTotalCountLabel, initContentMethods inherited from class io.jmix.flowui.kit.component.pagination.AbstractPagination
getJmixRowsPerPage, initNavigationButtons, setItemsPerPageMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
messages
-
uiComponents
-
currentAuthentication
-
flowuiProperties
-
itemsPerPage
-
loader
-
firstButtonClickRegistration
protected com.vaadin.flow.shared.Registration firstButtonClickRegistration -
previousButtonClickRegistration
protected com.vaadin.flow.shared.Registration previousButtonClickRegistration -
nextButtonClickRegistration
protected com.vaadin.flow.shared.Registration nextButtonClickRegistration -
lastButtonClickRegistration
protected com.vaadin.flow.shared.Registration lastButtonClickRegistration -
totalCountLabelClickRegistration
protected com.vaadin.flow.shared.Registration totalCountLabelClickRegistration -
itemsPerPageValueChangeRegistration
protected com.vaadin.flow.shared.Registration itemsPerPageValueChangeRegistration -
totalCountDelegate
-
samePage
protected boolean samePage -
lastPage
protected boolean lastPage -
refreshing
protected boolean refreshing -
state
-
lastState
-
size
protected int size -
start
protected int start -
numberDatatype
-
-
Constructor Details
-
SimplePagination
public SimplePagination()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
autowireDependencies
protected void autowireDependencies() -
initComponent
protected void initComponent() -
disableUi
protected void disableUi() -
createItemsPerPage
-
initItemsPerPage
-
getItemsPerPageDefaultValue
- Returns:
- items per page default value or
nullif not set
-
setItemsPerPageDefaultValue
Sets default value for the select component.- Parameters:
defaultValue- value to set
-
getItemsPerPageItems
- Returns:
- items that is used in select component
-
setItemsPerPageItems
Sets items which should be used in the select component. Items less than or equal to 0 are ignored, options greater than entity's max fetch size will be replaced by it.- Parameters:
itemsPerPageItems- items to set
-
isItemsPerPageUnlimitedItemVisible
public boolean isItemsPerPageUnlimitedItemVisible()- Returns:
trueif unlimited (null) item should be visible in the select component
-
setItemsPerPageUnlimitedItemVisible
public void setItemsPerPageUnlimitedItemVisible(boolean unlimitedItemVisible) Sets visibility of unlimited (null) option value in the items per page select component. If unlimited (null) option is selected component will try to load data withFlowuiProperties.getEntityMaxFetchSize(String)limitation. The default value is true.- Parameters:
unlimitedItemVisible- whether unlimited option should be visible
-
isItemsPerPageVisible
public boolean isItemsPerPageVisible()- Returns:
trueif items per page select component is visible
-
setItemsPerPageVisible
public void setItemsPerPageVisible(boolean itemsPerPageVisible) Sets visibility of items per page select component. This component contains options to limit the number of items for one page. If custom options are not set component will useFlowuiComponentProperties.getPaginationItemsPerPageItems(). The default value isfalse. -
addBeforeRefreshListener
public com.vaadin.flow.shared.Registration addBeforeRefreshListener(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.BeforeRefreshEvent<SimplePagination>> listener) Description copied from interface:PaginationComponentAdds before refresh listener. It is invoked when data should be refreshed after user actions: click on navigation buttons (next, last etc), change items per page value.- Specified by:
addBeforeRefreshListenerin interfacePaginationComponent<SimplePagination>- Parameters:
listener- listener to add- Returns:
- a registration object for removing an event listener
-
addAfterRefreshListener
public com.vaadin.flow.shared.Registration addAfterRefreshListener(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.AfterRefreshEvent<SimplePagination>> listener) Description copied from interface:PaginationComponentAdds after refresh listener. It is invoked when data is refreshed.- Specified by:
addAfterRefreshListenerin interfacePaginationComponent<SimplePagination>- Parameters:
listener- listener to add- Returns:
- a registration object for removing an event listener
-
getTotalCountDelegate
- Specified by:
getTotalCountDelegatein interfacePaginationComponent<SimplePagination>- Returns:
- delegate which is used to get the total count of items
-
setTotalCountDelegate
Description copied from interface:PaginationComponentSets delegate which is used to get the total count of items. For instance:@Autowired private DataManager dataManager; @Install(to = "pagination", subject = "totalCountDelegate") private Integer paginationTotalCountDelegate(LoadContext<User> dataLoadContext) { return dataManager.loadValue("select count(e) from demo_User e", Integer.class).one(); }- Specified by:
setTotalCountDelegatein interfacePaginationComponent<SimplePagination>- Parameters:
totalCountDelegate- total count delegate to set
-
getPaginationLoader
- Specified by:
getPaginationLoaderin interfacePaginationComponent<SimplePagination>- Returns:
- pagination data loader or
nullif not set
-
setPaginationLoader
Description copied from interface:PaginationComponentSets loader to the component.- Specified by:
setPaginationLoaderin interfacePaginationComponent<SimplePagination>- Parameters:
loader- pagination data loader to set
-
onRefreshItems
-
removeListeners
protected void removeListeners() -
initListeners
protected void initListeners() -
onTotalCountLabelClick
protected void onTotalCountLabelClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.html.Span> event) -
onFirstClick
protected void onFirstClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
onPreviousClick
protected void onPreviousClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
onNextClick
protected void onNextClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
onLastClick
protected void onLastClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
onItemsPerPageValueChange
protected void onItemsPerPageValueChange(com.vaadin.flow.component.HasValue.ValueChangeEvent<Integer> event) -
refreshData
protected boolean refreshData() -
onCollectionChanged
protected void onCollectionChanged() -
updateItemsPerPageAvailability
protected void updateItemsPerPageAvailability() -
updateTotalCountLabel
protected void updateTotalCountLabel() -
getLabelMessageKey
-
calculateRowsStatusLabelValue
-
setTotalCountLabelText
protected void setTotalCountLabelText(int totalCount) -
getTotalCount
protected int getTotalCount() -
loaderContainsItems
protected boolean loaderContainsItems() -
canSetUnlimitedValue
-
getEntityMaxFetchSize
-
setSilentlyItemsPerPageValue
-
fireBeforeRefreshEvent
-
fireAfterRefreshEvent
protected void fireAfterRefreshEvent()
-