public abstract class AbstractPagination<T extends JmixAbstractPagination> extends AbstractComponent<T> implements PaginationComponent
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractPagination.State |
PaginationComponent.AfterRefreshEvent, PaginationComponent.BeforeRefreshEvent
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
Modifier and Type | Field and Description |
---|---|
protected UiComponentProperties |
componentProperties |
protected PaginationDataBinder |
dataBinder |
protected java.lang.Integer |
itemsPerPageDefaultValue |
protected java.util.List<java.lang.Integer> |
itemsPerPageOptions |
protected com.vaadin.shared.Registration |
itemsPerPageValueChangeRegistration |
protected io.jmix.core.Messages |
messages |
protected java.util.List<java.lang.Integer> |
processedOptions |
protected ThemeConstantsManager |
themeConstantsManager |
protected java.util.function.Supplier<java.lang.Integer> |
totalCountDelegate |
protected UiProperties |
uiProperties |
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
AbstractPagination() |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addAfterRefreshListener(java.util.function.Consumer<PaginationComponent.AfterRefreshEvent> listener)
Adds after refresh listener.
|
io.jmix.core.common.event.Subscription |
addBeforeRefreshListener(java.util.function.Consumer<PaginationComponent.BeforeRefreshEvent> listener)
Adds before refresh listener.
|
protected boolean |
canSetUnlimitedValue(java.lang.Integer value) |
protected void |
checkDataBound() |
protected boolean |
dataBinderContainsItems() |
protected int |
findClosestValue(int maxResults,
java.util.List<java.lang.Integer> optionsList) |
protected void |
fireAfterRefreshEvent() |
protected PaginationComponent.BeforeRefreshEvent |
fireBeforeRefreshEvent() |
PaginationDataBinder |
getDataBinder() |
protected java.lang.Integer |
getDefaultOptionValue(java.util.List<java.lang.Integer> options,
io.jmix.core.metamodel.model.MetaClass metaClass) |
protected int |
getEntityMaxFetchSize(io.jmix.core.metamodel.model.MetaClass metaClass) |
protected int |
getEntityPageSize(io.jmix.core.metamodel.model.MetaClass metaClass) |
protected com.vaadin.ui.Button |
getFirstButton() |
protected int |
getItemsCountToDisplay() |
protected com.vaadin.ui.ComboBox<java.lang.Integer> |
getItemsPerPageComboBox() |
java.lang.Integer |
getItemsPerPageDefaultValue() |
java.util.List<java.lang.Integer> |
getItemsPerPageOptions() |
java.lang.Integer |
getItemsPerPageValue()
INTERNAL.
|
protected com.vaadin.ui.Button |
getLastButton() |
protected com.vaadin.ui.Button |
getNextButton() |
protected com.vaadin.ui.Button |
getPrevButton() |
protected int |
getTotalCount() |
java.util.function.Supplier<java.lang.Integer> |
getTotalCountDelegate() |
protected void |
initItemsPerPageLayout() |
protected void |
initItemsPerPageOptions() |
protected void |
initMaxResultValue()
Setup MaxResult value to data binder and to items per page ComboBox if it's visible.
|
protected boolean |
isEmptyOrNullDataBinder() |
boolean |
isItemsPerPageUnlimitedOptionVisible() |
boolean |
isItemsPerPageVisible() |
protected void |
onItemsPerPageValueChange(com.vaadin.data.HasValue.ValueChangeEvent<java.lang.Integer> event) |
protected java.util.List<java.lang.Integer> |
processOptions(java.util.List<java.lang.Integer> options,
io.jmix.core.metamodel.model.MetaClass metaClass)
Sorts options.
|
protected void |
removeItemsPerPageValueChangeSubscription() |
void |
setDataBinder(PaginationDataBinder dataBinder)
Sets a data binder.
|
void |
setItemsPerPageDefaultValue(java.lang.Integer defaultValue)
Sets default value for the items per page ComboBox.
|
void |
setItemsPerPageOptions(java.util.List<java.lang.Integer> options)
Sets items per page options which should be used in the ComboBox.
|
void |
setItemsPerPageUnlimitedOptionVisible(boolean unlimitedOptionVisible)
Sets visibility of unlimited (null) option value in the items per page ComboBox.
|
void |
setItemsPerPageValue(java.lang.Integer value)
INTERNAL.
|
void |
setItemsPerPageVisible(boolean itemsPerPageVisible)
Sets visibility of items per page ComboBox.
|
void |
setMessages(io.jmix.core.Messages messages) |
protected void |
setSilentlyItemsPerPageValue(java.lang.Integer value) |
void |
setThemeConstantsManager(ThemeConstantsManager themeConstantsManager) |
void |
setTotalCountDelegate(java.util.function.Supplier<java.lang.Integer> delegate)
Sets delegate which is used to get the total count of items.
|
void |
setUiComponentProperties(UiComponentProperties componentProperties) |
void |
setUiProperties(UiProperties uiProperties) |
protected void |
setupItemsPerPageValueChangeListener() |
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setParent, setResponsive, setStyleName, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFrame, setFrame
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
protected ThemeConstantsManager themeConstantsManager
protected io.jmix.core.Messages messages
protected UiComponentProperties componentProperties
protected UiProperties uiProperties
protected PaginationDataBinder dataBinder
protected java.util.function.Supplier<java.lang.Integer> totalCountDelegate
protected java.util.List<java.lang.Integer> itemsPerPageOptions
protected java.util.List<java.lang.Integer> processedOptions
protected java.lang.Integer itemsPerPageDefaultValue
protected com.vaadin.shared.Registration itemsPerPageValueChangeRegistration
@Autowired public void setThemeConstantsManager(ThemeConstantsManager themeConstantsManager)
@Autowired public void setMessages(io.jmix.core.Messages messages)
@Autowired public void setUiComponentProperties(UiComponentProperties componentProperties)
@Autowired public void setUiProperties(UiProperties uiProperties)
@Nullable public java.util.function.Supplier<java.lang.Integer> getTotalCountDelegate()
getTotalCountDelegate
in interface PaginationComponent
public void setTotalCountDelegate(@Nullable java.util.function.Supplier<java.lang.Integer> delegate)
PaginationComponent
@Autowired private DataManager dataManager; @Install(to = "pagination", subject = "totalCountDelegate") private Integer paginationTotalCountDelegate() { return dataManager.loadValue("select count(e) from demo_User e", Integer.class).one(); }
setTotalCountDelegate
in interface PaginationComponent
@Nullable public PaginationDataBinder getDataBinder()
getDataBinder
in interface PaginationComponent
public io.jmix.core.common.event.Subscription addBeforeRefreshListener(java.util.function.Consumer<PaginationComponent.BeforeRefreshEvent> listener)
PaginationComponent
addBeforeRefreshListener
in interface PaginationComponent
@Nullable public java.lang.Integer getItemsPerPageValue()
public void setItemsPerPageValue(@Nullable java.lang.Integer value)
value
- items per page valueprotected boolean canSetUnlimitedValue(@Nullable java.lang.Integer value)
protected PaginationComponent.BeforeRefreshEvent fireBeforeRefreshEvent()
public io.jmix.core.common.event.Subscription addAfterRefreshListener(java.util.function.Consumer<PaginationComponent.AfterRefreshEvent> listener)
PaginationComponent
addAfterRefreshListener
in interface PaginationComponent
protected void fireAfterRefreshEvent()
public boolean isItemsPerPageVisible()
isItemsPerPageVisible
in interface PaginationComponent
public void setItemsPerPageVisible(boolean itemsPerPageVisible)
PaginationComponent
UiComponentProperties.getPaginationItemsPerPageOptions()
. The default value is false
.setItemsPerPageVisible
in interface PaginationComponent
public boolean isItemsPerPageUnlimitedOptionVisible()
isItemsPerPageUnlimitedOptionVisible
in interface PaginationComponent
true
if unlimited (null) option should be visible in the items per page ComboBox.public void setItemsPerPageUnlimitedOptionVisible(boolean unlimitedOptionVisible)
PaginationComponent
UiProperties.getEntityMaxFetchSize(String)
limitation.
The default value is true
.setItemsPerPageUnlimitedOptionVisible
in interface PaginationComponent
public java.util.List<java.lang.Integer> getItemsPerPageOptions()
getItemsPerPageOptions
in interface PaginationComponent
public void setItemsPerPageOptions(java.util.List<java.lang.Integer> options)
PaginationComponent
setItemsPerPageOptions
in interface PaginationComponent
options
- items per page optionsUiProperties.getEntityMaxFetchSize(String)
@Nullable public java.lang.Integer getItemsPerPageDefaultValue()
getItemsPerPageDefaultValue
in interface PaginationComponent
null
public void setItemsPerPageDefaultValue(@Nullable java.lang.Integer defaultValue)
PaginationComponent
setItemsPerPageDefaultValue
in interface PaginationComponent
public void setDataBinder(PaginationDataBinder dataBinder)
PaginationComponent
setDataBinder
in interface PaginationComponent
protected void removeItemsPerPageValueChangeSubscription()
protected void setupItemsPerPageValueChangeListener()
protected void onItemsPerPageValueChange(com.vaadin.data.HasValue.ValueChangeEvent<java.lang.Integer> event)
protected void setSilentlyItemsPerPageValue(@Nullable java.lang.Integer value)
protected void initItemsPerPageLayout()
protected void initItemsPerPageOptions()
protected void initMaxResultValue()
protected int getTotalCount()
protected int getItemsCountToDisplay()
protected void checkDataBound()
protected boolean isEmptyOrNullDataBinder()
protected boolean dataBinderContainsItems()
protected com.vaadin.ui.Button getFirstButton()
protected com.vaadin.ui.Button getPrevButton()
protected com.vaadin.ui.Button getNextButton()
protected com.vaadin.ui.Button getLastButton()
protected com.vaadin.ui.ComboBox<java.lang.Integer> getItemsPerPageComboBox()
protected int getEntityMaxFetchSize(io.jmix.core.metamodel.model.MetaClass metaClass)
protected int getEntityPageSize(io.jmix.core.metamodel.model.MetaClass metaClass)
protected java.lang.Integer getDefaultOptionValue(java.util.List<java.lang.Integer> options, io.jmix.core.metamodel.model.MetaClass metaClass)
protected int findClosestValue(int maxResults, java.util.List<java.lang.Integer> optionsList)
protected java.util.List<java.lang.Integer> processOptions(java.util.List<java.lang.Integer> options, io.jmix.core.metamodel.model.MetaClass metaClass)
options
- items per page optionsmetaClass
- entity's MetaClass