Class AbstractSortColumnSelectionListener
java.lang.Object
org.eclipse.swt.events.SelectionAdapter
org.eclipse.nebula.widgets.pagination.AbstractPageControllerSelectionListener<PageableController>
org.eclipse.nebula.widgets.pagination.AbstractSortColumnSelectionListener
- All Implemented Interfaces:
java.util.EventListener,org.eclipse.swt.events.SelectionListener,org.eclipse.swt.internal.SWTEventListener
- Direct Known Subclasses:
SortTableColumnSelectionListener,SortTreeColumnSelectionListener
public abstract class AbstractSortColumnSelectionListener extends AbstractPageControllerSelectionListener<PageableController>
Abstract class to sort a widget (table tree etc...) column by using the
attached pagination controller of the SWT parent (table tree...).
-
Constructor Summary
Constructors Constructor Description AbstractSortColumnSelectionListener(java.lang.String propertyName)Constructor with property name and default sort (SWT.NONE).AbstractSortColumnSelectionListener(java.lang.String propertyName, int sortDirection)Constructor with property name and sort direction.AbstractSortColumnSelectionListener(java.lang.String propertyName, int sortDirection, PageableController controller)Constructor with property name and sort direction.AbstractSortColumnSelectionListener(java.lang.String propertyName, PageableController controller)Constructor with property name and default sort (SWT.NONE). -
Method Summary
Modifier and Type Method Description protected abstract org.eclipse.swt.widgets.WidgetgetParent(org.eclipse.swt.events.SelectionEvent e)Returns the parent of the sorted column (ex Table for TableColumn, Tree for TreeColumn).intgetSortDirection()Returns the sort directionSWT.UP,SWT.DOWN.java.lang.StringgetSortPropertyName()Returns the property name used to sort.protected abstract voidsort(org.eclipse.swt.events.SelectionEvent e)Sort the column od the parent of the sorted column (ex Table for TableColumn, Tree for TreeColumn).voidwidgetSelected(org.eclipse.swt.events.SelectionEvent e)Methods inherited from class org.eclipse.nebula.widgets.pagination.AbstractPageControllerSelectionListener
getController
-
Constructor Details
-
AbstractSortColumnSelectionListener
public AbstractSortColumnSelectionListener(java.lang.String propertyName)Constructor with property name and default sort (SWT.NONE).- Parameters:
propertyName- the sort property name.
-
AbstractSortColumnSelectionListener
public AbstractSortColumnSelectionListener(java.lang.String propertyName, PageableController controller)Constructor with property name and default sort (SWT.NONE).- Parameters:
propertyName- the sort property name.controller- the controller to update when sort is applied.
-
AbstractSortColumnSelectionListener
public AbstractSortColumnSelectionListener(java.lang.String propertyName, int sortDirection)Constructor with property name and sort direction.- Parameters:
propertyName- the sort property name.sortDirection- the sort directionSWT.UP,SWT.DOWN.
-
AbstractSortColumnSelectionListener
public AbstractSortColumnSelectionListener(java.lang.String propertyName, int sortDirection, PageableController controller)Constructor with property name and sort direction.- Parameters:
propertyName- the sort property name.sortDirection- the sort directionSWT.UP,SWT.DOWN.controller- the controller to update when sort is applied.
-
-
Method Details
-
widgetSelected
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)- Specified by:
widgetSelectedin interfaceorg.eclipse.swt.events.SelectionListener- Overrides:
widgetSelectedin classorg.eclipse.swt.events.SelectionAdapter
-
getSortPropertyName
public java.lang.String getSortPropertyName()Returns the property name used to sort.- Returns:
- the sort property name.
-
getSortDirection
public int getSortDirection()Returns the sort directionSWT.UP,SWT.DOWN.- Returns:
-
getParent
protected abstract org.eclipse.swt.widgets.Widget getParent(org.eclipse.swt.events.SelectionEvent e)Returns the parent of the sorted column (ex Table for TableColumn, Tree for TreeColumn).- Parameters:
e-- Returns:
-
sort
protected abstract void sort(org.eclipse.swt.events.SelectionEvent e)Sort the column od the parent of the sorted column (ex Table for TableColumn, Tree for TreeColumn).- Parameters:
e-
-