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
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected UiComponentProperties
protected PaginationDataLoader
protected Messages
protected UiProperties
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptioncom.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.void
protected void
protected boolean
containsItem
(Integer item) protected int
findClosestValue
(int maxResults, List<Integer> optionsList) protected Integer
getDefaultItemValue
(List<Integer> options, MetaClass metaClass) protected int
getEntityMaxFetchSize
(MetaClass metaClass) protected int
getEntityPageSize
(MetaClass metaClass) protected int
protected void
protected void
protected void
Setup MaxResult value to data binder and to items per page ComboBox if it's visible.protected boolean
processOptions
(List<Integer> options, MetaClass metaClass) Sorts options.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) protected void
setItemsPerPageValue
(Integer value) void
Sets 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, setLabelText
Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement
Methods 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, 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.HasEnabled
isEnabled, setEnabled
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
-
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:
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() -
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
-