viewer.setSorter(new MyViewerSorter());
public class MyViewerSorter extends ViewerSorter
{
@Override
public int compare(Viewer viewer, Object o1, Object o2)
{
return o1.toString().compareToIgnoreCase(o2.toString());
}
}
This will sort the elements in alphabetical order.
No comments:
Post a Comment