|
|||||||||||
| 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.feednread.frontend.components.newstable.NewsFeedTableViewerSorter
Sorts NewsFeedEntries embedded in a JFace
TableViewer upon an arbitrary TableColumn
criterion.
| Field Summary | |
private boolean |
ascending
true indicates ascending (default), false
descending sort order
|
private NewsFeedTableContentProvider |
contentProvider
The content provider to query the underlying model |
private int |
sortingColumn
The column that the sorting is done by |
private TableViewer |
viewer
The TableViewer 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 | |
NewsFeedTableViewerSorter(TableViewer viewer)
Creates a new NewsFeedTableViewerSorte instance linked to
the specified TableViewer.
|
|
| 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 should 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 TableViewer viewer
The TableViewer that the sorting is done for
private NewsFeedTableContentProvider contentProvider
The content provider to query the underlying model
| Constructor Detail |
public NewsFeedTableViewerSorter(TableViewer viewer)
Creates a new NewsFeedTableViewerSorte instance linked to
the specified TableViewer.
viewer - the viewer to link this
NewsFeedTableViewerSorte to| Method Detail |
public int getSortingColumn()
Gets the column index by which the sorting is done.
public void setSortingColumn(int columnIndex)
Sets the column index by which the sorting should be done.
columnIndex - the column index by which the sorting should be donepublic boolean isAscending()
Gets the sort order; true indicates ascending,
false descending sort order.
true for ascending, false for descending
sort order.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.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)
The default implementation of this method is based on comparing the
elements' categories as computed by the category framework
method. Elements within the same category are further subjected to a case
insensitive compare of their label strings, either as computed by the
content viewer's label provider, or their toString values
in other cases. Subclasses may override.
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 | ||||||||||