public class CmsPagingControls extends com.vaadin.v7.ui.HorizontalLayout
Modifier and Type | Class and Description |
---|---|
static interface |
CmsPagingControls.I_PagingCallback
Callback which is called when the user changes the page.
|
com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.SpacingHandler
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
Constructor and Description |
---|
CmsPagingControls()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCallback(CmsPagingControls.I_PagingCallback callback)
Adds a new page change callback.
|
void |
firePageChanged(int pageNum)
Notifies the registered listeners of a page change.
|
int |
getPage()
Gets the current page number.
|
void |
removeCallback(CmsPagingControls.I_PagingCallback callback)
Removes a registered callback.
|
void |
reset(int resultCount,
int pageSize,
boolean fireChanged)
Resets the paging controls (used when the size of the underlying list changes).
|
void |
setPage(int page,
boolean fireChanged)
Sets the page index.
|
void |
updateButtons()
Updates the button state, i.e. enables/disables the buttons depending on whether we are on the first or last page or not.
|
addComponentsAndExpand, getState, getState
addComponent, addComponent, addComponentAsFirst, addLayoutClickListener, getComponent, getComponentAlignment, getComponentCount, getComponentIndex, getCustomAttributes, getDefaultComponentAlignment, getExpandRatio, getMargin, isSpacing, iterator, readDesign, removeComponent, removeLayoutClickListener, replaceComponent, setComponentAlignment, setDefaultComponentAlignment, setExpandRatio, setMargin, setMargin, setSpacing, writeDesign
addComponentAttachListener, addComponentDetachListener, addComponents, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, setHeight, setWidth
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addComponents, getComponentIterator, moveComponentsFrom, removeAllComponents
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
public CmsPagingControls()
public void addCallback(CmsPagingControls.I_PagingCallback callback)
callback
- the callbackpublic void firePageChanged(int pageNum)
pageNum
- the page indexpublic int getPage()
public void removeCallback(CmsPagingControls.I_PagingCallback callback)
callback
- the callback to removepublic void reset(int resultCount, int pageSize, boolean fireChanged)
resultCount
- total number of resultspageSize
- size of a pagefireChanged
- true if the listeners should be notifiedpublic void setPage(int page, boolean fireChanged)
page
- the page indexfireChanged
- true if the registered listeners should be notifiedpublic void updateButtons()