Class PageableTree

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.Tree>
org.eclipse.nebula.widgets.pagination.tree.PageableTree
Type Parameters:
T - the pagination controller.
All Implemented Interfaces:
IPageChangedListener, org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
FormPageableTree

public class PageableTree
extends AbstractPaginationWidget<org.eclipse.swt.widgets.Tree>
Abstract class SWT Composite which host a SWT Tree 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 tree. For instance you can display navigation page links on the top of the tree.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected static int DEFAULT_TREE_STYLE  
    protected org.eclipse.jface.viewers.TreeViewer viewer
    the tree viewer

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

    handle
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
      PageableTree​(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.
      PageableTree​(org.eclipse.swt.widgets.Composite parent, int style, int treeStyle, int pageSize)  
      PageableTree​(org.eclipse.swt.widgets.Composite parent, int style, int treeStyle, int pageSize, IPageContentProvider pageContentProvider)
    Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
      PageableTree​(org.eclipse.swt.widgets.Composite parent, int style, int treeStyle, 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 PageableTree​(org.eclipse.swt.widgets.Composite parent, int style, int treeStyle, 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.Tree createTree​(org.eclipse.swt.widgets.Composite parent)
    Create the tree widget and layout it.
    protected org.eclipse.swt.widgets.Tree createTree​(org.eclipse.swt.widgets.Composite parent, int style)
    Create a tree.
    protected org.eclipse.swt.widgets.Tree 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 getTreeStyle()
    Returns the tree style.
    org.eclipse.jface.viewers.TreeViewer getViewer()
    Returns the tree 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

    • PageableTree

      public PageableTree​(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 tree 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
    • PageableTree

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

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

      public PageableTree​(org.eclipse.swt.widgets.Composite parent, int style, int treeStyle, 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
      treeStyle - the style of tree 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.
    • PageableTree

      protected PageableTree​(org.eclipse.swt.widgets.Composite parent, int style, int treeStyle, 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
      treeStyle - the style of tree 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.Tree 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.Tree>
      Parameters:
      parent - a widget which will be the parent of the new instance (cannot be null)
      Returns:
    • createTree

      protected org.eclipse.swt.widgets.Tree createTree​(org.eclipse.swt.widgets.Composite parent)
      Create the tree widget and layout it.
      Parameters:
      parent -
      Returns:
    • getTreeStyle

      protected int getTreeStyle()
      Returns the tree style.
      Returns:
    • getViewer

      public org.eclipse.jface.viewers.TreeViewer getViewer()
      Returns the tree viewer.
      Returns:
    • createTree

      protected org.eclipse.swt.widgets.Tree createTree​(org.eclipse.swt.widgets.Composite parent, int style)
      Create a tree.
      Parameters:
      parent - a widget which will be the parent of the new instance (cannot be null)
      style - the style of tree 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.Tree>