public class SimplePaginationImpl extends AbstractPagination<JmixSimplePagination> implements SimplePagination, VisibilityChangeNotifier, org.springframework.beans.factory.InitializingBean
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
VisibilityChangeNotifier.VisibilityChangeEvent
HasContextHelp.ContextHelpIconClickEvent
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoLoad |
protected BackgroundWorker |
backgroundWorker |
protected io.jmix.core.metamodel.datatype.Datatype |
countDatatype |
protected io.jmix.core.security.CurrentAuthentication |
currentAuthentication |
protected BackgroundTaskHandler<java.lang.Integer> |
itemsCountTaskHandler |
protected boolean |
lastPage |
protected AbstractPagination.State |
lastState |
protected com.vaadin.shared.Registration |
onFirstClickRegistration |
protected com.vaadin.shared.Registration |
onLastClickRegistration |
protected com.vaadin.shared.Registration |
onLinkClickRegistration |
protected com.vaadin.shared.Registration |
onNextClickRegistration |
protected com.vaadin.shared.Registration |
onPrevClickRegistration |
protected boolean |
refreshing |
protected boolean |
samePage |
protected int |
size |
protected int |
start |
protected AbstractPagination.State |
state |
componentProperties, dataBinder, itemsPerPageDefaultValue, itemsPerPageOptions, itemsPerPageValueChangeRegistration, messages, processedOptions, themeConstantsManager, totalCountDelegate, uiProperties
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
NAME
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
SimplePaginationImpl() |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addVisibilityChangeListener(java.util.function.Consumer<VisibilityChangeNotifier.VisibilityChangeEvent> listener) |
void |
afterPropertiesSet() |
protected JmixSimplePagination |
createComponent() |
protected com.vaadin.ui.Button |
getCountButton() |
protected com.vaadin.ui.Label |
getLabel() |
protected java.lang.String |
getLabelCountValue() |
protected java.lang.String |
getLabelMessageKey() |
protected BackgroundTask<java.lang.Long,java.lang.Integer> |
getLoadCountTask() |
protected void |
initComponent() |
protected void |
initListeners() |
boolean |
isAutoLoad() |
protected void |
loadItemsCount() |
protected void |
onCollectionChanged() |
protected void |
onFirstClick(com.vaadin.ui.Button.ClickEvent event) |
protected void |
onItemsPerPageValueChange(com.vaadin.data.HasValue.ValueChangeEvent<java.lang.Integer> event) |
protected void |
onLastClick(com.vaadin.ui.Button.ClickEvent event) |
protected void |
onLinkClick(com.vaadin.ui.Button.ClickEvent event) |
protected void |
onNextClick(com.vaadin.ui.Button.ClickEvent event) |
protected void |
onPrevClick(com.vaadin.ui.Button.ClickEvent event) |
protected void |
onRefreshItems(CollectionChangeType changeType) |
protected boolean |
refreshData() |
protected void |
removeListeners() |
void |
setAutoLoad(boolean autoLoad)
Sets whether items count should be loaded automatically.
|
void |
setBackgroundWorker(BackgroundWorker backgroundWorker) |
void |
setCurrentAuthentication(io.jmix.core.security.CurrentAuthentication currentAuthentication) |
void |
setDataBinder(PaginationDataBinder dataBinder)
Sets a data binder.
|
void |
setDatatypeRegistry(io.jmix.core.metamodel.datatype.DatatypeRegistry datatypeRegistry) |
void |
setVisible(boolean visible)
Sets visibility value for the component.
|
protected void |
showItemsCountValue(int count) |
protected void |
updateItemsPerPageAvailability() |
protected void |
updateNavigationButtonsAvailability() |
protected void |
updateTotalCountButton() |
addAfterRefreshListener, addBeforeRefreshListener, canSetUnlimitedValue, checkDataBound, dataBinderContainsItems, findClosestValue, fireAfterRefreshEvent, fireBeforeRefreshEvent, getDataBinder, getDefaultOptionValue, getEntityMaxFetchSize, getEntityPageSize, getFirstButton, getItemsCountToDisplay, getItemsPerPageComboBox, getItemsPerPageDefaultValue, getItemsPerPageOptions, getItemsPerPageValue, getLastButton, getNextButton, getPrevButton, getTotalCount, getTotalCountDelegate, initItemsPerPageLayout, initItemsPerPageOptions, initMaxResultValue, isEmptyOrNullDataBinder, isItemsPerPageUnlimitedOptionVisible, isItemsPerPageVisible, processOptions, removeItemsPerPageValueChangeSubscription, setItemsPerPageDefaultValue, setItemsPerPageOptions, setItemsPerPageUnlimitedOptionVisible, setItemsPerPageValue, setItemsPerPageVisible, setMessages, setSilentlyItemsPerPageValue, setThemeConstantsManager, setTotalCountDelegate, setUiComponentProperties, setUiProperties, 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, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAfterRefreshListener, addBeforeRefreshListener, getDataBinder, getItemsPerPageDefaultValue, getItemsPerPageOptions, getTotalCountDelegate, isItemsPerPageUnlimitedOptionVisible, isItemsPerPageVisible, setItemsPerPageDefaultValue, setItemsPerPageOptions, setItemsPerPageUnlimitedOptionVisible, setItemsPerPageVisible, setTotalCountDelegate
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, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
protected BackgroundWorker backgroundWorker
protected io.jmix.core.security.CurrentAuthentication currentAuthentication
protected boolean autoLoad
protected com.vaadin.shared.Registration onLinkClickRegistration
protected com.vaadin.shared.Registration onPrevClickRegistration
protected com.vaadin.shared.Registration onNextClickRegistration
protected com.vaadin.shared.Registration onFirstClickRegistration
protected com.vaadin.shared.Registration onLastClickRegistration
protected io.jmix.core.metamodel.datatype.Datatype countDatatype
protected boolean lastPage
protected boolean samePage
protected boolean refreshing
protected AbstractPagination.State state
protected AbstractPagination.State lastState
protected int start
protected int size
protected BackgroundTaskHandler<java.lang.Integer> itemsCountTaskHandler
protected JmixSimplePagination createComponent()
@Autowired public void setBackgroundWorker(BackgroundWorker backgroundWorker)
@Autowired public void setCurrentAuthentication(io.jmix.core.security.CurrentAuthentication currentAuthentication)
@Autowired public void setDatatypeRegistry(io.jmix.core.metamodel.datatype.DatatypeRegistry datatypeRegistry)
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected void initComponent()
protected void updateItemsPerPageAvailability()
public boolean isAutoLoad()
isAutoLoad
in interface SimplePagination
public void setAutoLoad(boolean autoLoad)
SimplePagination
[?]
. When it's enabled the component
makes a query to get the total count of items and shows it. The default value is false
.setAutoLoad
in interface SimplePagination
autoLoad
- pass true to enable auto load, or false otherwisepublic io.jmix.core.common.event.Subscription addVisibilityChangeListener(java.util.function.Consumer<VisibilityChangeNotifier.VisibilityChangeEvent> listener)
addVisibilityChangeListener
in interface VisibilityChangeNotifier
public void setVisible(boolean visible)
Component
setVisible
in interface Component
setVisible
in class AbstractComponent<JmixSimplePagination>
visible
- visible flagpublic void setDataBinder(PaginationDataBinder dataBinder)
PaginationComponent
setDataBinder
in interface PaginationComponent
setDataBinder
in class AbstractPagination<JmixSimplePagination>
protected void initListeners()
protected void removeListeners()
protected void onRefreshItems(CollectionChangeType changeType)
protected void onFirstClick(com.vaadin.ui.Button.ClickEvent event)
protected void onPrevClick(com.vaadin.ui.Button.ClickEvent event)
protected void onNextClick(com.vaadin.ui.Button.ClickEvent event)
protected void onLastClick(com.vaadin.ui.Button.ClickEvent event)
protected void onLinkClick(com.vaadin.ui.Button.ClickEvent event)
protected void onItemsPerPageValueChange(com.vaadin.data.HasValue.ValueChangeEvent<java.lang.Integer> event)
onItemsPerPageValueChange
in class AbstractPagination<JmixSimplePagination>
protected boolean refreshData()
protected void onCollectionChanged()
protected void updateTotalCountButton()
protected java.lang.String getLabelMessageKey()
protected java.lang.String getLabelCountValue()
protected void updateNavigationButtonsAvailability()
protected void loadItemsCount()
protected BackgroundTask<java.lang.Long,java.lang.Integer> getLoadCountTask()
protected void showItemsCountValue(int count)
protected com.vaadin.ui.Button getCountButton()
protected com.vaadin.ui.Label getLabel()