com.extjs.gxt.ui.client.widget
Class PagingToolBar

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.PagingToolBar
All Implemented Interfaces:
Listener, Observable, com.google.gwt.user.client.EventListener

public class PagingToolBar
extends Component
implements Listener

A specialized toolbar that is bound to a ListLoader and provides automatic paging controls.

 

Nested Class Summary
 class PagingToolBar.PagingToolBarMessages
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
PagingToolBar(int pageSize)
          Creates a new paging tool bar with the given page size.
 
Method Summary
 void add(ToolItem item)
          Adds an item to the end of the tool bar (pre-render).
 void bind(PagingLoader 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 tool bar's messages.
 int getPageSize()
          Returns the current page size.
 int getTotalPages()
          Returns the total number of pages.
 void handleEvent(BaseEvent be)
          Sent when an event that the listener has registered for occurs.
 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 previos page.
 void refresh()
          Refreshes the data using the current configuration.
 void remove(ToolItem item)
          Removes the item from the toolbar (pre-render).
 void setActivePage(int page)
          Sets the active page (1 to page count inclusive).
 void setMessages(PagingToolBar.PagingToolBarMessages messages)
          Sets the tool bar's 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).
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addPlugin, addStyleName, addWidgetListener, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getData, getElement, getId, getItemId, getModel, getState, getToolTip, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isVisible, onBrowserEvent, onComponentEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setHeight, setId, setIntStyleAttribute, setItemId, setPixelSize, setSize, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setWidth, show, sinkEvents, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PagingToolBar

public PagingToolBar(int pageSize)
Creates a new paging tool bar with the given page size.

Parameters:
pageSize - the page size
Method Detail

add

public void add(ToolItem item)
Adds an item to the end of the tool bar (pre-render). Can be used to add custom components to the tool bar. Use AdapterToolItem to adapt and component to be used in the tool bar.

Parameters:
item - the item to add

bind

public void bind(PagingLoader loader)
Binds the toolbar to the loader.

Parameters:
loader - the loader

clear

public void clear()
Clears the current toolbar text.


first

public void first()
Moves to the first page.


getActivePage

public int getActivePage()
Returns the active page.

Returns:
the active page

getMessages

public PagingToolBar.PagingToolBarMessages getMessages()
Returns the tool bar's messages.

Returns:
the messages

getPageSize

public int getPageSize()
Returns the current page size.

Returns:
the page size

getTotalPages

public int getTotalPages()
Returns the total number of pages.

Returns:
the

handleEvent

public void handleEvent(BaseEvent be)
Description copied from interface: Listener
Sent when an event that the listener has registered for occurs.

Specified by:
handleEvent in interface Listener
Parameters:
be - the event which occurred

isReuseConfig

public boolean isReuseConfig()
Returns true if the previous load config is reused.

Returns:
the reuse config state

isShowToolTips

public boolean isShowToolTips()
Returns true if tooltip are enabled.

Returns:
the show tooltip state

last

public void last()
Moves to the last page.


next

public void next()
Moves to the last page.


previous

public void previous()
Moves the the previos page.


refresh

public void refresh()
Refreshes the data using the current configuration.


remove

public void remove(ToolItem item)
Removes the item from the toolbar (pre-render).

Parameters:
item - the item to remove

setActivePage

public void setActivePage(int page)
Sets the active page (1 to page count inclusive).

Parameters:
page - the page

setMessages

public void setMessages(PagingToolBar.PagingToolBarMessages messages)
Sets the tool bar's messages.

Parameters:
messages - the messages

setPageSize

public void setPageSize(int pageSize)
Sets the current page size. This method does not effect the data currently being displayed. The new page size will not be used until the next load request.

Parameters:
pageSize - the new page size

setReuseConfig

public void setReuseConfig(boolean reuseConfig)
True to reuse the previous load config (defaults to true).

Parameters:
reuseConfig - true to reuse the load config

setShowToolTips

public void setShowToolTips(boolean showToolTips)
Sets if the button tool tips should be displayed (defaults to true, pre-render).

Parameters:
showToolTips - true to show tool tips