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 styleprotected org.eclipse.jface.viewers.TableViewer
viewer
the table viewer -
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.nebula.widgets.pagination.AbstractPaginationWidget
createCompositeBottom, createCompositeTop, createUI, getCompositeBottom, getCompositeTop, getPageLoader, getPageLoaderHandler, getPageRendererBottomFactory, getPageRendererTopFactory, getWidget, pageIndexChanged, pageSizeChanged, refreshPage, setLocale, setPageLoader, setPageLoaderHandler, sortChanged, totalElementsChanged
Methods inherited from class org.eclipse.nebula.widgets.pagination.AbstractPageControllerComposite
createController, dispose, getController, getLocale, getPageContentProvider, localeChanged, setCurrentPage
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
-
Field Details
-
DEFAULT_TABLE_STYLE
protected static final int DEFAULT_TABLE_STYLEdefault table style- See Also:
- Constant Field Values
-
viewer
protected org.eclipse.jface.viewers.TableViewer viewerthe table viewer
-
-
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 sizePageableController.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 constructtableStyle
- the style of table to constructpageSize
- 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 constructtableStyle
- the style of table to constructpageSize
- 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 constructtableStyle
- the style of table to constructpageSize
- 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 classAbstractPaginationWidget<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
Returns the default page renderer factory for the top region.- Returns:
-
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 classAbstractPaginationWidget<org.eclipse.swt.widgets.Table>
-