Class PageableTable

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.nebula.widgets.pagination.AbstractPageControllerComposite
org.eclipse.nebula.widgets.pagination.AbstractPaginationWidget<org.eclipse.swt.widgets.Table>
org.eclipse.nebula.widgets.pagination.table.PageableTable
Type Parameters:
T - the pagination controller.
All Implemented Interfaces:
IPageChangedListener, org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
FormPageableTable

public class PageableTable
extends AbstractPaginationWidget<org.eclipse.swt.widgets.Table>
Abstract class SWT Composite which host a SWT Table linked to a pagination controller to display data with pagination. The refreshPage() must be implemented to load paginated data and update the total element of the controller. This composite is able to to add another Composite on the top and on the bottom of the table. For instance you can display navigation page links on the top of the table.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected static int DEFAULT_TABLE_STYLE
    default table style
    protected org.eclipse.jface.viewers.TableViewer viewer
    the table viewer

    Fields inherited from class org.eclipse.swt.widgets.Control

    handle
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
      PageableTable​(org.eclipse.swt.widgets.Composite parent, int style)
    Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
      PageableTable​(org.eclipse.swt.widgets.Composite parent, int style, int tableStyle, int pageSize)  
      PageableTable​(org.eclipse.swt.widgets.Composite parent, int style, int tableStyle, int pageSize, IPageContentProvider pageContentProvider)
    Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
      PageableTable​(org.eclipse.swt.widgets.Composite parent, int style, int tableStyle, int pageSize, IPageContentProvider pageContentProvider, ICompositeRendererFactory pageRendererTopFactory, ICompositeRendererFactory pageRendererBottomFactory)
    Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
    protected PageableTable​(org.eclipse.swt.widgets.Composite parent, int style, int tableStyle, int pageSize, IPageContentProvider pageContentProvider, ICompositeRendererFactory pageRendererTopFactory, ICompositeRendererFactory pageRendererBottomFactory, boolean createUI)
    Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
  • Method Summary

    Modifier and Type Method Description
    protected org.eclipse.swt.widgets.Table createTable​(org.eclipse.swt.widgets.Composite parent)
    Create the table widget and layout it.
    protected org.eclipse.swt.widgets.Table createTable​(org.eclipse.swt.widgets.Composite parent, int style)
    Create a table.
    protected org.eclipse.swt.widgets.Table createWidget​(org.eclipse.swt.widgets.Composite parent)
    Create the widget linked to the pagination controller.
    static ICompositeRendererFactory getDefaultPageRendererBottomFactory()
    Returns the default page renderer factory for the bottom region.
    static ICompositeRendererFactory getDefaultPageRendererTopFactory()
    Returns the default page renderer factory for the top region.
    protected int getTableStyle()
    Returns the table style.
    org.eclipse.jface.viewers.TableViewer getViewer()
    Returns the table viewer.
    void refreshPage()
    Refresh the page.

    Methods inherited from class org.eclipse.swt.widgets.Composite

    changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString

    Methods inherited from class org.eclipse.swt.widgets.Scrollable

    computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar

    Methods inherited from class org.eclipse.swt.widgets.Control

    addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update

    Methods inherited from class org.eclipse.swt.widgets.Widget

    addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.swt.graphics.Drawable

    isAutoScalable
  • Field Details

  • Constructor Details

    • PageableTable

      public PageableTable​(org.eclipse.swt.widgets.Composite parent, int style)
      Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. Here default page size PageableController.DEFAULT_PAGE_SIZE and default table style SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL are used.
      Parameters:
      parent - a widget which will be the parent of the new instance (cannot be null)
      style - the style of widget to construct
    • PageableTable

      public PageableTable​(org.eclipse.swt.widgets.Composite parent, int style, int tableStyle, int pageSize, IPageContentProvider pageContentProvider)
      Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
      Parameters:
      parent - a widget which will be the parent of the new instance (cannot be null)
      style - the style of widget to construct
      tableStyle - the style of table to construct
      pageSize - size of the page (number items displayed per page).
    • PageableTable

      public PageableTable​(org.eclipse.swt.widgets.Composite parent, int style, int tableStyle, int pageSize)
    • PageableTable

      public PageableTable​(org.eclipse.swt.widgets.Composite parent, int style, int tableStyle, int pageSize, IPageContentProvider pageContentProvider, ICompositeRendererFactory pageRendererTopFactory, ICompositeRendererFactory pageRendererBottomFactory)
      Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
      Parameters:
      parent - a widget which will be the parent of the new instance (cannot be null)
      style - the style of widget to construct
      tableStyle - the style of table to construct
      pageSize - size of the page (number items displayed per page).
      pageRendererTopFactory - the page renderer factory used to create a SWT Composite on the top of the widget. Null if none Composite must be created.
      pageRendererBottomFactory - the page renderer factory used to create a SWT Composite on the bottom of the widget. Null if none Composite must be created.
    • PageableTable

      protected PageableTable​(org.eclipse.swt.widgets.Composite parent, int style, int tableStyle, int pageSize, IPageContentProvider pageContentProvider, ICompositeRendererFactory pageRendererTopFactory, ICompositeRendererFactory pageRendererBottomFactory, boolean createUI)
      Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
      Parameters:
      parent - a widget which will be the parent of the new instance (cannot be null)
      style - the style of widget to construct
      tableStyle - the style of table to construct
      pageSize - size of the page (number items displayed per page).
      pageRendererTopFactory - the page renderer factory used to create a SWT Composite on the top of the widget. Null if none Composite must be created.
      pageRendererBottomFactory - the page renderer factory used to create a SWT Composite on the bottom of the widget. Null if none Composite must be created.
      createUI - true if the UI must be created and false otherwise.
  • Method Details

    • createWidget

      protected org.eclipse.swt.widgets.Table createWidget​(org.eclipse.swt.widgets.Composite parent)
      Description copied from class: AbstractPaginationWidget
      Create the widget linked to the pagination controller.
      Specified by:
      createWidget in class AbstractPaginationWidget<org.eclipse.swt.widgets.Table>
      Parameters:
      parent - a widget which will be the parent of the new instance (cannot be null)
      Returns:
    • createTable

      protected org.eclipse.swt.widgets.Table createTable​(org.eclipse.swt.widgets.Composite parent)
      Create the table widget and layout it.
      Parameters:
      parent -
      Returns:
    • getTableStyle

      protected int getTableStyle()
      Returns the table style.
      Returns:
    • getViewer

      public org.eclipse.jface.viewers.TableViewer getViewer()
      Returns the table viewer.
      Returns:
    • createTable

      protected org.eclipse.swt.widgets.Table createTable​(org.eclipse.swt.widgets.Composite parent, int style)
      Create a table.
      Parameters:
      parent - a widget which will be the parent of the new instance (cannot be null)
      style - the style of table to constr * @return
    • getDefaultPageRendererTopFactory

      public static ICompositeRendererFactory getDefaultPageRendererTopFactory()
      Returns the default page renderer factory for the top region.
      Returns:
    • getDefaultPageRendererBottomFactory

      public static ICompositeRendererFactory getDefaultPageRendererBottomFactory()
      Returns the default page renderer factory for the bottom region.
      Returns:
    • refreshPage

      public void refreshPage()
      Description copied from class: AbstractPaginationWidget
      Refresh the page. This method should load paginated list data, update the viewer and update the pagination controller with total elements.
      Specified by:
      refreshPage in class AbstractPaginationWidget<org.eclipse.swt.widgets.Table>