|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.jface.viewers.ViewerComparator
org.eclipse.jface.viewers.ViewerSorter
net.sourceforge.java.util.gui.jface.viewers.TableViewerSorter
Generic ViewerSorter extension for Viewer
instances using ITableContentProvider implementations.
| Field Summary | |
private boolean |
ascending
true indicates ascending (default), false
descending sort order
|
private ITableContentProvider |
contentProvider
The ITableContentProvider used to query the underlying
model
|
private int |
sortingColumn
The column that the sorting is done by |
private Viewer |
viewer
The Viewer that the sorting is done for |
| Fields inherited from class org.eclipse.jface.viewers.ViewerSorter |
collator |
| Fields inherited from class org.eclipse.jface.viewers.ViewerComparator |
|
| Constructor Summary | |
TableViewerSorter(Viewer viewer,
ITableContentProvider contentProvider)
Creates a new TableViewerSorter instance linked to the
specified Viewer.
|
|
| Method Summary | |
int |
compare(Viewer viewer,
Object e1,
Object e2)
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element. |
int |
getSortingColumn()
Gets the column index by which the sorting is done. |
boolean |
isAscending()
Gets the sort order; true |
void |
setAscending(boolean ascending)
Sets the sort order to be used; true |
void |
setSortingColumn(int columnIndex)
Sets the column index by which the sorting is to be done. |
void |
sort()
Sorts the underlying model data and refreshes the associated TableViewer to reflect the new sorting.
|
| Methods inherited from class org.eclipse.jface.viewers.ViewerSorter |
getCollator, getComparator |
| Methods inherited from class org.eclipse.jface.viewers.ViewerComparator |
category, isSorterProperty, sort |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int sortingColumn
The column that the sorting is done by
private boolean ascending
true indicates ascending (default), false
descending sort order
private Viewer viewer
The Viewer that the sorting is done for
private ITableContentProvider contentProvider
The ITableContentProvider used to query the underlying
model
| Constructor Detail |
public TableViewerSorter(Viewer viewer,
ITableContentProvider contentProvider)
Creates a new TableViewerSorter instance linked to the
specified Viewer.
viewer - the Viewer to link this
TableViewerSorter to| Method Detail |
public int getSortingColumn()
Gets the column index by which the sorting is done.
getSortingColumn()public void setSortingColumn(int columnIndex)
Sets the column index by which the sorting is to be done.
columnIndex - the column index by which the sorting is to be donegetSortingColumn()public boolean isAscending()
Gets the sort order; true indicates ascending,
false descending sort order.
true for ascending, false for descending
sort order- See Also:
setAscending(boolean)public void setAscending(boolean ascending)
Sets the sort order to be used; true indicates ascending,
false descending sort order.
ascending - true for ascending, false for
descending sort order- See Also:
isAscending()public void sort()
Sorts the underlying model data and refreshes the associated
TableViewer to reflect the new sorting.
public int compare(Viewer viewer,
Object e1,
Object e2)
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.
viewer - the viewere1 - the first elemente2 - the second element
0 if the first element is equal to the
second element; and a positive number if the first element is greater
than the second element
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||