ITableLabelProvider labelProvider =
(ITableLabelProvider) elementKindViewer.getLabelProvider();
ViewerSorter sorter = new AlphabeticSorter(
new LabelProviderToString(labelProvider, colIndex));
if (SWT.UP == direction) {
sorter = new InverseSorter(sorter);
}
Table tableControl = (Table) elementKindViewer.getControl();
elementKindViewer.setSorter(sorter);
tableControl.setSortColumn(column);