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 Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected UiComponentPropertiesprotected PaginationDataLoaderprotected Messagesprotected UiPropertiesFields inherited from class io.jmix.flowui.kit.component.pagination.JmixItemsPerPage
BASE_CLASS_NAME, ITEMS_PER_PAGE_SELECT_CLASS_NAME, itemsPerPageDefaultValue, itemsPerPageItems, itemsPerPageSelect, LABEL_CLASS_NAME, labelSpan -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddItemsPerPageValueChangeListener(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.voidprotected voidprotected booleancontainsItem(Integer item) protected intfindClosestValue(int maxResults, List<Integer> optionsList) protected IntegergetDefaultItemValue(List<Integer> options, MetaClass metaClass) protected intgetEntityMaxFetchSize(MetaClass metaClass) protected intgetEntityPageSize(MetaClass metaClass) protected intprotected voidprotected voidprotected voidSetup MaxResult value to data binder and to items per page ComboBox if it's visible.protected booleanprocessOptions(List<Integer> options, MetaClass metaClass) Sorts options.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) protected voidsetItemsPerPageValue(Integer value) voidSets loader to the component.Methods inherited from class io.jmix.flowui.kit.component.pagination.JmixItemsPerPage
createItemsPerPageSelect, createLabelSpan, getItemsPerPageDefaultValue, getItemsPerPageItems, getLabelText, initContent, isItemsPerPageUnlimitedItemVisible, setItemsPerPageDefaultValue, setItemsPerPageItems, setItemsPerPageUnlimitedItemVisible, setLabelTextMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, 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.HasEnabled
isEnabled, setEnabledMethods 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
-
componentProperties
-
uiProperties
-
loader
-
processedItems
-
-
Constructor Details
-
ItemsPerPage
public ItemsPerPage()
-
-
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() -
setPaginationLoader
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
-
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
Sorts options. Options less than or equal 0 are ignored. Values greater than MaxFetchSize are replaced by MaxFetchSize.- Parameters:
options- items per page optionsmetaClass- entity's MetaClass- Returns:
- sorted options
-
getEntityMaxFetchSize
-
getEntityPageSize
-
getDefaultItemValue
-
findClosestValue
-
isItemsPerPageVisible
protected boolean isItemsPerPageVisible() -
containsItem
-