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 classes/interfaces inherited from interface io.jmix.flowui.component.PaginationComponent
PaginationComponent.AfterRefreshEvent<T extends AbstractPagination>, PaginationComponent.BeforeRefreshEvent<T extends AbstractPagination>
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected CurrentAuthentication
protected com.vaadin.flow.shared.Registration
protected FlowuiProperties
protected ItemsPerPage
protected com.vaadin.flow.shared.Registration
protected com.vaadin.flow.shared.Registration
protected boolean
protected SimplePagination.State
protected PaginationDataLoader
protected Messages
protected com.vaadin.flow.shared.Registration
protected Datatype<?>
protected com.vaadin.flow.shared.Registration
protected boolean
protected boolean
protected int
protected int
protected SimplePagination.State
protected Function<LoadContext,
Integer> protected com.vaadin.flow.shared.Registration
protected UiComponents
Fields 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, totalCountSpan
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addAfterRefreshListener
(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.AfterRefreshEvent<SimplePagination>> listener) Adds after refresh listener.com.vaadin.flow.shared.Registration
addBeforeRefreshListener
(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.BeforeRefreshEvent<SimplePagination>> listener) Adds before refresh listener.void
protected void
protected String
protected boolean
canSetUnlimitedValue
(Integer value) protected ItemsPerPage
protected void
protected void
protected int
getEntityMaxFetchSize
(MetaClass metaClass) protected String
protected int
protected void
protected void
initItemsPerPage
(ItemsPerPage itemsPerPage) protected void
boolean
boolean
protected boolean
protected void
protected void
onFirstClick
(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected void
onItemsPerPageValueChange
(com.vaadin.flow.component.HasValue.ValueChangeEvent<Integer> event) protected void
onLastClick
(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected void
onNextClick
(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected void
onPreviousClick
(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected void
onRefreshItems
(CollectionChangeType changeType) protected void
onTotalCountLabelClick
(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.html.Span> event) protected boolean
protected void
void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setItemsPerPageDefaultValue
(Integer defaultValue) Sets default value for the select component.void
setItemsPerPageItems
(List<Integer> itemsPerPageItems) Sets items which should be used in the select component.void
setItemsPerPageUnlimitedItemVisible
(boolean unlimitedItemVisible) Sets visibility of unlimited (null) option value in the items per page select component.void
setItemsPerPageVisible
(boolean itemsPerPageVisible) Sets visibility of items per page select component.void
Sets loader to the component.protected void
void
setTotalCountDelegate
(Function<LoadContext, Integer> totalCountDelegate) Sets delegate which is used to get the total count of items.protected void
setTotalCountLabelText
(int totalCount) protected void
protected void
protected void
Methods inherited from class io.jmix.flowui.kit.component.pagination.JmixSimplePagination
createInnerBar, createNavigationButton, createStatusBar, createStatusSpan, createTotalCountSpan, getRowsStatusLabel, getTotalCountLabel, initContent
Methods inherited from class io.jmix.flowui.kit.component.pagination.AbstractPagination
getJmixRowsPerPage, initNavigationButtons, setItemsPerPage
Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement
Methods 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, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods 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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in 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
null
if 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:
true
if 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:
true
if 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:PaginationComponent
Adds 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:
addBeforeRefreshListener
in 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:PaginationComponent
Adds after refresh listener. It is invoked when data is refreshed.- Specified by:
addAfterRefreshListener
in interfacePaginationComponent<SimplePagination>
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
getTotalCountDelegate
- Specified by:
getTotalCountDelegate
in interfacePaginationComponent<SimplePagination>
- Returns:
- delegate which is used to get the total count of items
-
setTotalCountDelegate
Description copied from interface:PaginationComponent
Sets 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:
setTotalCountDelegate
in interfacePaginationComponent<SimplePagination>
- Parameters:
totalCountDelegate
- total count delegate to set
-
getPaginationLoader
- Specified by:
getPaginationLoader
in interfacePaginationComponent<SimplePagination>
- Returns:
- pagination data loader or
null
if not set
-
setPaginationLoader
Description copied from interface:PaginationComponent
Sets loader to the component.- Specified by:
setPaginationLoader
in 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()
-