public class PagingToolBar extends ToolBar
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 |
---|---|
static interface |
PagingToolBar.PagingToolBarAppearance |
static interface |
PagingToolBar.PagingToolBarMessages |
ToolBar.ToolBarAppearance
HBoxLayoutContainer.HBoxLayoutAlign, HBoxLayoutContainer.HBoxLayoutContainerAppearance
BoxLayoutContainer.BoxLayoutContainerAppearance, BoxLayoutContainer.BoxLayoutData, BoxLayoutContainer.BoxLayoutPack
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
InsertPanel.ForIsWidget
HasWidgets.ForIsWidget
DEBUG_ID_PREFIX
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.
|
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.
|
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, setHorizontalSpacing, setMinButtonWidth, setSpacing, setVerticalSpacing
addOverflowHandler, getHBoxLayoutAlign, isEnableOverflow, setEnableOverflow, setHBoxLayoutAlign
add, getPack, getPadding, getScrollOffset, insert, isAdjustForFlexRemainder, setAdjustForFlexRemainder, setPack, setPadding, setScrollOffset
insert, insert
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize
add, add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, disable, enable, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, remove
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
add
add
getWidgetIndex
getWidget, getWidgetCount, getWidgetIndex, remove
@UiConstructor 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 loaderpublic void clear()
clear
in interface HasWidgets
clear
in class Container
public 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 tipsCopyright © 2015. All rights reserved.