public class PagingToolBar extends ToolBar
A specialized toolbar that is bound to a PagingLoader
and provides automatic paging controls.
The tool bar is "bound" to the loader using the bind(PagingLoader)
method.
Enabling & disabling child toolbar items: The paging toolbar setEnable overrides any child toolbar items setEnable. Given the paging toolbar overrides the child toolbar items setEnable, deferring child toolbar enablement is needed after the onload. So when the paging toolbar is enabled the has a child toolbar the items enablement can be overridden by scheduling their enablement. The example below shows an example of scheduling child toolbar item enablement.
Modifier and Type | Class and Description |
---|---|
protected static class |
PagingToolBar.DefaultPagingToolBarMessages |
static interface |
PagingToolBar.PagingToolBarAppearance |
static interface |
PagingToolBar.PagingToolBarMessages |
ToolBar.ToolBarAppearance
HBoxLayoutContainer.HBoxLayoutAlign, HBoxLayoutContainer.HBoxLayoutContainerAppearance
BoxLayoutContainer.BoxLayoutContainerAppearance, BoxLayoutContainer.BoxLayoutData, BoxLayoutContainer.BoxLayoutPack
Modifier and Type | Field and Description |
---|---|
protected int |
activePage |
protected LabelToolItem |
afterText |
protected LabelToolItem |
beforePage |
protected PagingLoadConfig |
config |
protected LabelToolItem |
displayText |
protected TextButton |
first |
protected TextButton |
last |
protected PagingLoader<PagingLoadConfig,?> |
loader |
protected TextButton |
next |
protected int |
pages |
protected int |
pageSize |
protected TextBox |
pageText |
protected TextButton |
prev |
protected TextButton |
refresh |
protected boolean |
showToolTips |
protected int |
start |
protected int |
totalLength |
hasOverflow, hiddens, more, moreMenu
forceLayoutCommand, forceLayoutOnResize, hadLayoutRunning, layoutCommand, layoutRequiredThisEventLoop, layoutRunning
adjustSize, allowTextSelection, cacheSizes, disableContextMenu, disabled, disabledStyle, ensureVisibilityOnSizing, height, hidden, lastSize, layer, left, mask, maskMessage, monitorWindowResize, pageX, pageY, resizeHandler, shim, tabIndex, toolTip, toolTipConfig, top, width, windowResizeDelay, windowResizeTask
Constructor and Description |
---|
PagingToolBar(int pageSize)
Creates a new paging tool bar.
|
PagingToolBar(ToolBar.ToolBarAppearance toolBarAppearance,
PagingToolBar.PagingToolBarAppearance appearance,
int pageSize)
Creates a new tool bar.
|
Modifier and Type | Method and Description |
---|---|
void |
bind(PagingLoader<? extends PagingLoadConfig,?> loader)
Binds the toolbar to the loader.
|
void |
clear()
Clears the current toolbar text.
|
protected void |
doEnableButtons(boolean enabled)
Called when a load request is initialed and called after completion of the load request.
|
protected void |
doLoadRequest(int offset,
int limit) |
void |
first()
Moves to the first page.
|
int |
getActivePage()
Returns the active page.
|
PagingToolBar.PagingToolBarMessages |
getMessages()
Returns the toolbar messages.
|
int |
getPageSize()
Returns the current page size.
|
PagingToolBar.PagingToolBarAppearance |
getPagingToolbarAppearance()
Returns the toolbar appearance.
|
int |
getTotalPages()
Returns the total number of pages.
|
boolean |
isButtonsEnabled()
Returns true if the paging toolbar buttons are enabled.
|
boolean |
isReuseConfig()
Returns true if the previous load config is reused.
|
boolean |
isShowToolTips()
Returns true if tooltip are enabled.
|
void |
last()
Moves to the last page.
|
void |
next()
Moves to the last page.
|
protected void |
onLoad(LoadEvent<PagingLoadConfig,PagingLoadResult<?>> event) |
protected void |
onPageChange() |
void |
previous()
Moves the the previous page.
|
void |
refresh()
Refreshes the data using the current configuration.
|
void |
setActivePage(int page)
Sets the active page (1 to page count inclusive).
|
void |
setMessages(PagingToolBar.PagingToolBarMessages messages)
Sets the toolbar messages.
|
void |
setPageSize(int pageSize)
Sets the current page size.
|
void |
setReuseConfig(boolean reuseConfig)
True to reuse the previous load config (defaults to true).
|
void |
setShowToolTips(boolean showToolTips)
Sets if the button tool tips should be displayed (defaults to true, pre-render).
|
getAppearance, getHorizontalSpacing, getMinButtonWidth, getVerticalSpacing, onFocus, onInsert, setHorizontalSpacing, setMinButtonWidth, setSpacing, setVerticalSpacing
addOverflowHandler, addWidgetToMenu, clearMenu, doLayout, getHBoxLayoutAlign, getWidgetWidth, hideComponent, initMore, isEnableOverflow, isHidden, onOverflow, onRemove, onUnoverflow, setEnableOverflow, setHBoxLayoutAlign, unhideComponent
add, getContainerTarget, getPack, getPadding, getScrollOffset, insert, isAdjustForFlexRemainder, setAdjustForFlexRemainder, setPack, setPadding, setScrollOffset
insert, insert
applyLayout, applyLayout, forceLayout, forceLayoutOnChildren, forceLayoutOnChildren, getLeftRightMargins, getParentLayoutWidget, getSideMargins, getTopBottomMargins, isLayoutRunning, isOrWasLayoutRunning, isWidgetVisible, onBeforeDoLayout, onLoad, onResize, onResize
add, add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, adjustIndex, adopt, checkIndexBoundsForInsertion, disable, doAttachChildren, doDetachChildren, doPhysicalAttach, doPhysicalDetach, enable, ensureGroupingHandlerRegistration, findWidget, getChildren, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, onWidgetHide, onWidgetShow, orphan, remove, remove, remove
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addGestureRecognizer, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleDependentName, addStyleOnOver, adjustPosition, adjustSize, applyState, assertAfterRender, assertPreRender, blur, clearSizeCache, disableContextMenu, disableEvents, enableEvents, fireCancellableEvent, fireEvent, focus, getData, getElement, getFocusEl, getFocusSupport, getGestureRecognizer, getGestureRecognizerCount, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getPositionEl, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideShadow, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, notifyHide, notifyShow, onAfterFirstAttach, onAttach, onBlur, onBrowserEvent, onDetach, onDisable, onEnable, onHide, onHideContextMenu, onPosition, onRightClick, onShow, onShowContextMenu, onTouch, onUnload, onWindowResize, removeStyleDependentName, removeStyleOnOver, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setMonitorWindowResize, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setStyleDependentName, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
protected int activePage
protected int pages
protected LabelToolItem beforePage
protected LabelToolItem afterText
protected LabelToolItem displayText
protected PagingLoadConfig config
protected TextButton first
protected TextButton prev
protected TextButton next
protected TextButton last
protected TextButton refresh
protected PagingLoader<PagingLoadConfig,?> loader
protected TextBox pageText
protected boolean showToolTips
protected int start
protected int pageSize
protected int totalLength
public PagingToolBar(int pageSize)
pageSize
- the page sizepublic PagingToolBar(ToolBar.ToolBarAppearance toolBarAppearance, PagingToolBar.PagingToolBarAppearance appearance, int pageSize)
toolBarAppearance
- the tool bar appearanceappearance
- the paging tool bar appearancepageSize
- the page sizepublic void bind(PagingLoader<? extends PagingLoadConfig,?> loader)
loader
- the loaderprotected void doEnableButtons(boolean enabled)
enabled
- the enabled statepublic void first()
public int getActivePage()
public PagingToolBar.PagingToolBarAppearance getPagingToolbarAppearance()
public PagingToolBar.PagingToolBarMessages getMessages()
public int getPageSize()
public int getTotalPages()
public boolean isButtonsEnabled()
public boolean isReuseConfig()
public boolean isShowToolTips()
public void last()
public void next()
public void previous()
public void refresh()
public void setActivePage(int page)
page
- the pagepublic void setMessages(PagingToolBar.PagingToolBarMessages messages)
messages
- the messagespublic void setPageSize(int pageSize)
pageSize
- the new page sizepublic void setReuseConfig(boolean reuseConfig)
reuseConfig
- true to reuse the load configpublic void setShowToolTips(boolean showToolTips)
showToolTips
- true to show tool tipsprotected void doLoadRequest(int offset, int limit)
protected void onLoad(LoadEvent<PagingLoadConfig,PagingLoadResult<?>> event)
protected void onPageChange()
Copyright © 2018. All rights reserved.