public class SegmentViewerComparator
extends ViewerComparator
Segment
.ORDER_NAME
: Orders the Segements by their names.ORDER_OCCURRENCE
: Orders the Segements by their position.Modifier and Type | Field and Description |
---|---|
protected static int |
ORDER_NAME
Sort order: the name of the
Segment . |
protected static int |
ORDER_OCCURRENCE
Sort order: the starting position (offset) of the
Segment .This is the default sort order. |
Constructor and Description |
---|
SegmentViewerComparator()
Constructor.
The default sort order is ORDER_OCCURRENCE . |
Modifier and Type | Method and Description |
---|---|
int |
compare(Viewer viewer,
java.lang.Object e1,
java.lang.Object e2)
Compares two
Segment objects. |
boolean |
isSorterProperty(java.lang.Object element,
java.lang.String property) |
void |
setSortOrderAlphabetical()
Sets the sort order to
ORDER_NAME . |
void |
setSortOrderOccurrence()
Sets the sort order to
ORDER_OCCURRENCE . |
protected static final int ORDER_NAME
Segment
.protected static final int ORDER_OCCURRENCE
Segment
.public SegmentViewerComparator()
ORDER_OCCURRENCE
.public void setSortOrderAlphabetical()
ORDER_NAME
.public void setSortOrderOccurrence()
ORDER_OCCURRENCE
.public boolean isSorterProperty(java.lang.Object element, java.lang.String property)
public int compare(Viewer viewer, java.lang.Object e1, java.lang.Object e2)
Segment
objects.org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)